HackerTrans
TopNewTrendsCommentsPastAskShowJobs

shawa_a_a

no profile record

Submissions

Show HN: Xlerb – A Compiled "Forth" for the Beam

6 points·by shawa_a_a·8 เดือนที่ผ่านมา·0 comments

Tube: A subway route planner in Dyalog APL (2011)

dfns.dyalog.com
23 points·by shawa_a_a·8 เดือนที่ผ่านมา·4 comments

comments

shawa_a_a
·9 เดือนที่ผ่านมา·discuss
It's been a long time since I've programmed Prolog so I'm not sure if these ideas are even relevant (global state might be more than enough!) ; but at first impressions from the readme this really reminds me of ETS

https://www.erlang.org/doc/apps/stdlib/ets.html

Essentially system-global state under named tables.

Have/did you consider having named `env` instances? This would allow for say, feature flags to be kept in a `features` set of relations.

You could also draw from Erlang's 'match specs' and query with a predicate over the keys.
shawa_a_a
·9 เดือนที่ผ่านมา·discuss
I think that's going to be hard to find, depending on your definition of 'regular', tbh.

The BEAM's grown up along with Erlang and so the culture and optimisations are built up all around function application, list processing, recursion, and pattern matching etc.

https://github.com/llaisdy/beam_languages is a decent list of the diverse languages that have been implemented on it, but nothing quite like 'regular for and while loops'.

The BEAM itself is a plain aul register machine though, so it could be done!

https://www.erlang.org/blog/a-brief-beam-primer/
shawa_a_a
·9 เดือนที่ผ่านมา·discuss
They're probably using some features of LiveView; I'm not too familiar with how HTMX works, but with LiveView you can define all of your logic and state handling on the _backend_, with page diffs pushed to the client over a websocket channel (all handled out of the box).

It comes with some tradeoffs compared to fully client-side state, but it's a really comfortable paradigm to program in, especially if you're not from a frontend background, and really clicks with the wider Elixir/Erlang problem solving approach.

https://hexdocs.pm/phoenix_live_view/js-interop.html#handlin...

Hooks let you do things like have your DOM update live, but then layer on some JS in response.

For example you could define a custom `<chart>` component, which is inserted into the DOM with `data-points=[...]`, and have a hook then 'hydrate' it with e.g. a D3 or VegaLite plot.

Since Phoenix/LiveView is handling the state, your JS needs only be concerned about that last-mile JS integration; no need to pair it with another virtual DOM / state management system.

https://hexdocs.pm/phoenix_live_view/js-interop.html#client-...
shawa_a_a
·11 เดือนที่ผ่านมา·discuss
I've heard of domain fronting, where you host something on a subdomain of a large provider like Azure or Amazon. Is this what you're talking about when you say

> - Host on a piece of infrastructure that's so big that you can't effectively block it without causing a major internet outage (think: S3, Cloudflare R2, etc).

How can one bounce VPN traffic through S3? Or are you just talking about hosting client software, ingress IP address lists, etc?