Hacker Newsnew | past | comments | ask | show | jobs | submit | shawa_a_a's commentslogin

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.


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/


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-...


For BEAM MCP you probably want to look at TideWave, which runs _in your application_ to give the LLM context and an execution environment.

https://hexdocs.pm/tidewave/mcp.html


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?


That's generally for distribution, but yeah, it's a form of domain fronting.

There are some more niche techniques that are _really_ cool but haven't gained widespread adoption, too, like refractive routing. The logistics of getting that working are particularly challenging since you need a willing partner who'll undermine some of their trustworthiness with some actors to support (what is, normally, to them) your project.


If I understand correctly, refractive routing basically just gets big trustworthy cloud providers to host the VPNs so that third world governments can't block them without blocking the cloud too. It's an unfortunate solution since tech platforms are international entities that should be neutral. When America asks them to take sides and prevent other countries from implementing their desired policies, America is spending the political capital and trust that tech companies worked hard to earn. It's also really foolish of those countries to just block things outright. They could probably achieve their policy goals simply by slowing down access to VPN endpoints.


I thought a lot of the domain-fronting approaches have largely been closed from policy changes at major CDNs (e.g. https://techcommunity.microsoft.com/blog/azurenetworkingblog...) . Or is it still possible through other approaches?


ECH (Encrypted Client Hello) brings back a kind of domain fronting, except you don't need to front anything at all. the Client Hello itself is encrypted, so the SNI is hidden.

hopefully ECH will catch on. I suspect the corporate backlash over domain fronting was them not wanting to be caught in the crossfire if their domain was used as a front. if e.g. Signal used "giphy.com" as a front, Russia might block giphy to block Signal. but if Signal is hosted on, say, AWS, and ECH was used, Russia would have no option other than blocking the entirety of AWS, since all TLS handshakes to AWS would look the same.

though cloud providers (other than CloudFlare, respect!) don't seem to care about censorship or surveillance anymore, and might decline to adopt ECH if some lucrative market complains.


Surprised to not see Acko.net mentioned in comments already - he uses similar aids in one of his blog posts to break down complex numbers and ultimately fractals.

Likely right up your street!

https://acko.net/blog/how-to-fold-a-julia-fractal/


Agreed - updated with colour again


It’s not the most accessible colour scheme - I’ll have a look and tweak it so dark mode is more readable.

I’d definitely be really grateful for help with that! I’m not planning to publish to the Mac App Store, but it would be great to have the build step a bit more compliant with current practises.


Email me (from my profile) and I can have a look with your sandbox issue.


Since going down this rabbit hole, I gave Anki another fair shot and actually RTFM :) the blog post warrants an update

https://docs.ankiweb.net/deck-options.html#learning-steps Details what _actually happens_ when you pick again/hard/good etc. I much prefer understanding this to the vibes-based approach of “did you pause before answering”.

Secondly turns out you can indeed very easily set up type-to-answer in a deck by editing the front template and adding

{type:Field}

where field is the answer part of the card’s data.

So… I’m actually using Anki again. I’m still very happy I did this, it was a fun little journey!


I have been bedroom DJing, and wanting to expand what I can do with the hardware I already have.

Using `midiex` for Elixir I’ve written a fully fledged driver for Ableton Push, letting me use it as essentially a 4-deck version of Pioneer’s DDJ-XP2 sub controller with Rekordbox.

It implements basic statefulness so that the rotary encoders can be used, as well as a paging system so the 64 performance pads can be mapped to different functions. It also supports track browsing and loading, which is helpful if you want to use say DVS with an external mixer and don’t want to be hunched over a laptop dragging tracks around.

It’s also got some additional capabilities which I’ve not seen on other hardware like dedicated faders for stem separation levels.

It’s been a great exercise in combing two hobbies, learning about MIDI as well as being able to personalise my setup for my own use. I haven’t open sourced any of it just yet whilst I’m still tweaking things but I’d be interested in collaborating with anyone who also has one of these devices and has programmed it. I’m looking to use the display on it next, whose protocol Ableton have some (albeit scant) documentation for.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: