jbzfn, to elixir
@jbzfn@mastodon.social avatar

Elixir: The only Sane Choice in an Insane World • Brian Cardarella • GOTO 2017

https://youtube.com/watch?v=gom6nEvtl3U

happyborg, to rust
@happyborg@fosstodon.org avatar

Async Rust is a Bad Language by Matt Kline.

Very good intro and thought provoking article on and , and their use in .

It champions 's model of concurrency which takes me back. Back to the time I failed to get funding for a start-up to build an compiler targeting i386. Which was largely a ploy to get the UK government to buy me some neat kit 🤷‍♂️

Anyway, here's the article:
https://bitbashing.io/async-rust.html

chriskrycho, to rust
@chriskrycho@mastodon.social avatar

Fantastic write-up here from Hillel Wayne on what makes so hard: https://buttondown.email/hillelwayne/archive/what-makes-concurrency-so-hard/ – it hits on a bunch of themes I have been mulling on while working on the new async/await chapter for The Programming Language book.

An intuitive-but-worth-saying bit I would add to this, which he touches on but does not elaborate: In most of our programming, we can actually expect things to proceed in order, basically corresponding to the lines of code in our program.

abnv, to programming
@abnv@fantastic.earth avatar

I wrote the fourth part of my series “Implementing Co, a small programming language with coroutines”. And this time, we add support for channels in Co for inter-coroutine communication. https://abhinavsarkar.net/posts/implementing-co-4/

janriemer, to rust

1 Hour Dive into #Asynchronous Rust - by Herbert Wolverson:

https://farside.link/https://www.youtube.com/watch?v=0HwrZp9CBD4
(or YT: https://www.youtube.com/watch?v=0HwrZp9CBD4)

This is probably the best end-to-end overview of #async #Rust you can get! So much valuable information packed into 1 hour. Love it!

Thank you @herberticus for this excellent presentation. 🙏

Boost this to the moon, my fellow Rustaceans! :ferris: :boost_love: The video is one month old and only has ~1,500 views.😬

#RustLang #Learning #Tutorial #Concurrency #AsyncProgramming

abcdw, to golang
@abcdw@fosstodon.org avatar

Found a nice talk on concurrency. It has a very brief comparison of different concurrency models, like Erlang's Actors, Hoare's CSP, Go's goroutines, Clojure's core.async, Concurrent ML (aka Fibers in Guile).

Primary focus on Concurrent ML (but examples are in Scheme with type annotations ><).

https://youtu.be/pf4VbP5q3P0

#go #golang #clojure #lisp #guile #scheme #ocaml #concurrency #erlang

rhonabwy.com, to swift
@rhonabwy.com@rhonabwy.com avatar

This weekend I was frustrated with my debugging, and just not up to digging in and carefully, meticulously analyzing what was happening. So … I took a left turn (at Alburquerque) and decided to explore an older idea to see if it was interesting and/or useful. My challenging debugging was all about network code, for a collaborative, peer to peer sharing thing; more about that effort some other time.

A bit of back story

A number of years ago when I was working with a solar energy manufacturer, I was living and breathing events, APIs, and running very distributed, sometimes over crap network connections, systems. One of the experiments I did (that worked out extremely well) was to enable distributed tracing across the all the software components, collecting and analyzing traces to support integration testing. Distributed tracing, and the now-popular CNCF OpenTelemetry project weren’t a big thing, but they were around – kind of getting started. The folks (Yuri Shkuro, at least) at Uber had released Jaeger, an open-source trace collector with web-based visualization, which was enough to get started. I wrote about that work back in 2019 (that post still gets some recurring traffic from search engines, although it’s pretty dated now and not entirely useful).

We spun up our services, enabled tracing, and ran integration tests on the whole system. After which, we had the traces available for visual review. It was useful enough that we ended up evolving it so that a single developer could stand up most of their pieces locally (with a sufficiently beefy machine), and capture and view the traces locally. That provided a great feedback loop as they could see performance and flows in the system while they were developing fixes, updates and features. I wanted to see, this time with an iOS/macOS focused library, how far I could get trying to replicate that idea (time boxed to the weekend).

The Experiment!

I’ve been loosely following the server-side swift distributed tracing efforts since it started, and it looked pretty clear that I could use it directly. Moritz Lang publishes swift-otel, which is a Swift native, concurrency supported library. With his examples, it was super quick to hack into my test setup. The library is set up to run with service-lifecycle pieces over SwiftNIO, so there’s a pile of dependencies that come in with it. To add to my library, I’d be a little hesitant, but an integration test thing, I’m totally good with that. There were some quirks to using it with XCTest, most of which I hacked around by shoving the tracer setup into a global actor and exposing an idempotent bootstrap call. With that in place, I added explicit traces into my tests, and then started adding more and more, including into my library, and could see the results in a locally running instance of Jaeger (running Jaeger using Docker).

Some Results

The following image is an overview of the traces generated by a single test (testCreate):

https://josephheck.files.wordpress.com/2024/04/trace_overview.pngThe code I’m working with is all pushing events over web sockets, so inside of the individual spans (which are async closures in my test) I’ve dropped in some span events, one of which is shown in detail below:

https://josephheck.files.wordpress.com/2024/04/trace_with_detail.pngIn a lot of respects, this is akin to dropping in os_signposts that you might view in Instruments, but it’s external to Xcode infrastructure. Don’t get me wrong, I love Instruments and what it does – it’s been amazing and really the gold standard in tooling for me for years – but I was curious how far this approach would get me.

Choices and Challenges

Using something like this in production – with live-running iOS or macOS apps – would be another great end-to-end scenario. More so if the infrastructure your app was working from also used tracing. There’s a separate tracing project at CNCF – OpenTelemetry Swift – that looks oriented towards doing just that. I seriously considered using it, but I didn’t see a way to use that package to instrument my library and not bring in the whole pile of dependencies. With the swift-distributed-tracing library, it’s an easy (and small) dependency add – and you only need to take the hit of the extra dependencies when you want to use the tracing.

And I’ll just “casually” mention that if you pair this with server-side swift efforts, the Hummingbird project has support for distributed tracing currently built in. I expect Vapor support isn’t too far off, and it’s a continued focus to add more distributed tracing support for a number of prevalent server-side swift libraries over this coming summer.

See for Yourself (under construction/YMMV/etc)

I’ve tossed up my hack-job of a wrapper for tracing during testing with iOS and macOS – DistributedTracer, if you want to experiment with this kind of thing yourself. Feel free to use it, although if you’re amazed with the results – ALL credit should go to Moritz, the contributors to his package and the contributors to swift-distributed-tracing, since they did the heavy lifting. The swift-otel library itself is undergoing some major API surface changes – so if you go looking, I worked from the current main branch rather than the latest release. Moritz shared with me that while the API was not completely solid yet, this is more of the pattern he wants to expose for an upcoming 1.0 release.

Onward from here

I might push the DistributedTracer package further in the future. I think there’s real potential there, but it is not without pitfalls. Some of the challenges stem from constantly exporting data from an iOS app, so there’s a privacy (and privacy manifest) bit that needs to be seriously considered. There are also challenges with collecting enough data (but not too much), related choices in sampling so that it aligns with traces generated from infrastructure, as well as how to reliably transfer it from device to an endpoint. Nothing that can’t be overcome, but it’s not a small amount of work either.

Weekend hacking complete, I’m calling this a successful experiment. Okay, now back to actually debugging my library…

https://rhonabwy.com/2024/04/02/distributed-tracing-with-testing-on-ios-and-macos/

image/png

alexelcu, to programming
@alexelcu@social.alexn.org avatar
pixel, to programming
@pixel@social.pixels.pizza avatar
alexelcu, to programming
@alexelcu@social.alexn.org avatar

"Rust Atomics and Locks"

A book on low-level concurrency in Rust. Explains atomics, mutexes, memory ordering, integration with OS APIs.

https://marabos.nl/atomics/

martind, to random
@martind@mastodon.online avatar

Just found @groue Semaphore project. And I think this is the cleanest, easiest way of controlling async/await in Swift. Well done!

https://github.com/groue/Semaphore

pixel, to programming
@pixel@social.pixels.pizza avatar

“SwiftNIO is Apple non-blocking networking library. It can be used to write either client libraries or server frameworks and works on macOS, iOS and Linux.”


https://www.process-one.net/blog/swiftnio-futures-and-promises/

konstantin, to swift
@konstantin@social.headbright.eu avatar

Hey friends, do your future selves a favour and turn this on 😍

alvinashcraft, to dotnet
@alvinashcraft@hachyderm.io avatar
DelftPL, to ProgrammingLanguages

The Software Technology department at TU Delft is hiring new assistant and associate professors! This is an open call for any research field within one of our groups, so if you are a PL researcher and are interested to join us you are very welcome to apply. You can find more information about the positions and the application procedure at https://www.tudelft.nl/ewi/over-de-faculteit/afdelingen/software-technology/computer-science-open-call.

paulk, to random
kittylyst, to Java
@kittylyst@mastodon.social avatar
jaanus, to swift
@jaanus@iosdev.space avatar

#introduction

I’m on Mastodon for two things.

I build things on Apple platforms. I make @tact. I read (a lot) and post (a little) about related technologies: #Swift, #SwiftUI, #Combine, #CloudKit, #CoreData, #Xcode, #concurrency, as well as product design.

I support Ukraine. I follow Ukrainians and friends of 🇺🇦. Please donate to 🇺🇦 until 🗑🇷🇺 is gone: https://u24.gov.ua or any other respected charity. My Twitter is mostly about Ukraine - https://twitter.com/jaanus

janriemer, to rust

Inko - A language for building concurrent software with confidence

https://inko-lang.org/

Looks quite nice! Almost like a mix of and (with 75% Rust and 25% Go).

jbzfn, (edited ) to rust
@jbzfn@mastodon.social avatar

🤔 How Much Memory Do You Need to Run 1 Million Concurrent Tasks?
➥ Piotr Kołaczkowski


https://pkolaczk.github.io/memory-consumption-of-async/

wrstscrnnm6, to programming
@wrstscrnnm6@mastodon.social avatar

I was getting an error "failed to allocate XXXXXX b"

I copy the number into wolfram alpha to see how much data that really is.

5.3 Zettabytes.

How the hell is this program trying to allocate the equivalent of ... all of the data sent over the internet in a year, five times over?

Somewhere between my terminal and the browser the string of numbers got doubled.

Never have I been so relieved to find out my program was only trying to allocate 53Gb of ram.

wrstscrnnm6,
@wrstscrnnm6@mastodon.social avatar

The CPU intensive part of the job finishes in less than two minutes. It then takes 6-12 additional minutes back on the main thread to handle all the data that those other threads produced.

hywan, to rust
@hywan@fosstodon.org avatar

Tasks are the wrong abstraction, https://blog.yoshuawuyts.com/tasks-are-the-wrong-abstraction/.

Another excellent article by @yosh. I still need to digest it; I reckon it contains many (great) ideas I agree with.

brightbox, to random
@brightbox@ruby.social avatar
brightbox,
@brightbox@ruby.social avatar

Here in part 2 we create some systemd philosophers and see what they're contemplating. It's the first time we've had to clarify that fork meant the eating utensil and not the system call!

Solving the Dining Philosophers Problem with systemd: https://www.brightbox.com/blog/2024/01/11/solving-dining-philosophers-with-systemd-part-2/

brightbox,
@brightbox@ruby.social avatar

And finally part 3, where we actually solve the Dining Philosophers Problem, using a variant of the Chandry/Misra "hygiene" solution. All with only UNIX, systemd and some bash scripting!

https://www.brightbox.com/blog/2024/01/17/solving-dining-philosophers-with-systemd-part-3/

brennansv, to random
@brennansv@sfba.social avatar

Heard of function coloring? It is about async code.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines