Discussion
Loading...

Post

Log in
  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online  ·  activity timestamp 5 days ago

The pain when trying to imagine something running as a CLI program that's a good POSIX-y citizen but also does complicated dynamic async stuff internally. #Nodejs has a stupid tcsetattr stomp. #Python's async story feels weak. Got curious about #Elixir/#Erlang relatively speaking, looked at erl_signal_server to see about cleaning up on SIGINT instead of triggering emulator break, but it's not in the handleable list! --erl +Bd allows classic immediate exit, but not cleanup. Argh.

  • Copy link
  • Flag this post
  • Block
gram
gram
@orsinium@fosstodon.org replied  ·  activity timestamp 5 days ago

@dasyatidprime

Go is probably the best fit for the described task. created by unix pioneers, small binaries, cross-compilation, fast startup, great concurrency, easy signal handling.

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 5 days ago

@orsinium It would indeed be pretty good for this!—if I didn't also want user-level in-proc dynloading for extension points. It's still very static-compilation-y, right?

I'd also kind of want to ask where my supervision-tree-equivalent is for goroutines. Maybe there is one nowadays? Not that I'd have one in Node either, but the way promises desugar feels a bit more first-class at least.

I haven't written Go in a while, so I could be way out of date. 🙂

  • Copy link
  • Flag this comment
  • Block
gram
gram
@orsinium@fosstodon.org replied  ·  activity timestamp 5 days ago

@dasyatidprime

Depending on what you need, there are some options for dynamic code execution:

* text/templates
* yaegi
* starlark
* wasm with wazero

Go doesn't have OTP-like concurrency conveniences, like supervision tree. it's quite low-level. you start goroutines, pass context into them for cancelation, channel for work distribution, maybe another channel for sending results and failures back, and WaitGroup for awaiting. more steps, same result. there is also errgroup to handle some of it.

  • Copy link
  • Flag this comment
  • Block
Robin Tarsiger
Robin Tarsiger
@dasyatidprime@mastodon.online replied  ·  activity timestamp 5 days ago

@orsinium What might be alternatively interesting is if I could embed Lua or JS, though the LuaJIT language divergence situation makes me sad. I see luago and goja but they look shaky.

Currently leaning toward “either Elixir or Node, paper over small gaps with C”. Scheme might also be decent here, though Gambit seems currently to be broken in Fedora…

(I realize I'm being rather vague here on a lot of points—much of this is just me thinking out loud, as you might have guessed. Heh.)

  • Copy link
  • Flag this comment
  • Block
gram
gram
@orsinium@fosstodon.org replied  ·  activity timestamp 5 days ago

@dasyatidprime

well, starlark is pretty much python 3.6. idk about embedding lua or js, they are not my favorites :)

  • Copy link
  • Flag this comment
  • Block

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.2-alpha.7 no JS en
Automatic federation enabled
Log in
  • Explore
  • About
  • Members
  • Code of Conduct