HNHacker News
TopNewBestAskShowJobs

shawa_a_a

167 karma · joined December 11, 2017

submissionscomments
shawa_a_a··on Global key-value metadata storage for Scryer Prolog
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··on Gleam OTP – Fault Tolerant Multicore Programs with Actors
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··on Ask HN: How does one build large front end apps without a framework like React?
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··on Expert: LSP for Elixir
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

shawa_a_a··on Ask HN: The government of my country blocked VPN access. What should I use?
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?

shawa_a_a··on Show HN: I was curious about spherical helix, ended up making this visualization
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/

shawa_a_a··on Show HN: Reviving a 20 year old OS X App
Agreed - updated with colour again
shawa_a_a··on Show HN: Reviving a 20 year old OS X App
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.

shawa_a_a··on Show HN: Reviving a 20 year old OS X App
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!

shawa_a_a··on Ask HN: What are you working on? (March 2025)
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.

shawa_a_a··on Camera Ignores Perspective and Sees Behind Walls
This isn’t exactly the case. The camera has an actuating mirror on the end of the rotating arm that allows it to point at arbitrary angles.

https://youtu.be/aXfTgCCsRSg (T=4:30)

The emulating different lenses part is that with this setup you can parametrically collect specific rays bouncing off the object (presumably the angle of the mirror with respect to radius), and the resulting image will be the same as you’d get from a lens with those parameters.

shawa_a_a··on Everything Is Just Functions: 1 week with David Beazley and SICP
Not the other commenter, but my team has been using Elixir in production (soft real-time distributed systems) for several years to great success. The approachable syntax has been great for folks new to the language coming on board and sort of, not realising they’re “doing FP”.

Generally I’d say Elixir’s lack of “hard” static typing is more than made up for what you get from the BEAM VM, OTP, its concurrency model, supervisors etc.

That said if you’re interested in leveraging the platform whilst also programming with types I’d recommend checking out Gleam (https://gleam.run), which I believe uses an HM type system.

shawa_a_a··on Bypassing regulatory locks, hacking AirPods and Faraday cages
A commenter on Reddit [1] pointed out that you can access the hearing test feature directly by using a special URL:

    x-apple-health://HearingAppPlugin.healthplugin/HearingTest

I wonder if there’s a similar deep link to be found to enable Hearing Aid mode?

1: https://www.reddit.com/r/AirpodsPro/comments/1gftyqo/is_the_...

shawa_a_a··on I'm not mutable, I'm partially instantiated
It's a bold statement to call something a Prolog successor! Are you aiming for a general purpose logic programming language like Prolog, or targeting the use case of querying knowledge bases?

One of the draws to Prolog is its immensely simple syntax: A.R:B = true in your case would be represented as simply r(A, B).

It looks like you've elevated some set theory properties to syntax, and have added some neat sugar over chained relations. Have you found areas where this really shines as compared to writing more standard Prolog/Datalog queries? I'm afraid I couldn't see many examples on first look at your Github.

shawa_a_a··on Programming languages that blew my mind (2023)
I would second Prolog as mind-blowing. I've found you're typically confronted with fully engaging with the core of whatever problem you're solving, and only that core. This is probably what can make it so frustrating sometimes as you have no option but to work out the hard stuff nearly immediately; not to mention that unconsidered edge cases, mistakes can cause some pretty opaquely wrong results, or the query not terminating, which can make conventional debugging pretty difficult. The guarantees you get with using the 'pure' core of Prolog do open up some really interesting avenues though, for example Scryer's debugging library is quite neat in affording _semantic_ debugging: https://www.scryer.pl/debug

Just some additional commentary too - I think this post quite misrepresents it with some of the comparisons.

Prolog at its core is SLD Resolution [1] (a form of search) over Horn Clauses [2] (first order logic). Queries posted to the runtime are attempts to find a set of values which will satisfy (cause to be true) the query – whilst SQL is founded on relational algebra which more closely aligned with set theory.

Whilst there's probably some isomorphism between satisfying/refuting a logical predicate, and performing various set operations, I'd say it's a bit of a confusion of ideas to say that SQL is based on 'a subset of Prolog'. The author might be thinking about Datalog [3], which is indeed a syntactic subset of Prolog.

[1]: https://en.wikipedia.org/wiki/SLD_resolution [2]: https://en.wikipedia.org/wiki/Horn_clause [3]: https://en.wikipedia.org/wiki/Datalog

shawa_a_a··on Weird Lexical Syntax
The comment character is also configurable:

    git config core.commentchar <char>
This is helpful where you want to use use say, markdown to have tidily formatted commit messages make up your pull request body too.
shawa_a_a··on Use Prolog to write psycho-philosophical case studies
I don’t know about your particular use case, but it is never a bad idea to learn Prolog.

https://www.metalevel.at/prolog

The Power of Prolog is an extremely in depth, comprehensive introduction that starts right from fundamentals, and goes into some pretty advanced topics. It’s a really great resource, with well-produced accompanying videos, and leans into properly grokking the language and the “Prolog way” of problem solving.

I’d make a meta point that learning Prolog and forcing yourself to solve problems the “prolog way” serves as a great exercise in understanding the importance of using the right tool for the job, and working with, rather than in spite of , your tools.

shawa_a_a··on Scratches in 2001: A Space Osyssey (2018)
In the spirit of scratches, it was only at a recent 70mm film screening that I spotted the rig used for the floating pen scene as Floyd falls asleep in the shuttle.

As the weightlessness begins, his pen floats away - if you look really really carefully you can spot that it’s actually embedded in a thin plastic film which is rotating about an axis, given away by minute scratches on its surface.

shawa_a_a··on Book of Kells (2018)
For anyone else interested, and to clarify, "the Book of Kells experience" is to stand in for the exhibit in the Old Library while it's closed for renovations until 2025 [1].

Rather than and Old Library, it's a huge red prefab building in New Square. Might not be quite as impressive as the original tour.

1: https://www.tcd.ie/old-library-campaign/faq/

shawa_a_a··on COBOL on Wheelchair: Micro web-framework for COBOL
I've been intrigued enough to pull down Gnu COBOL and attempt to write some simple programs, and found it to be quite an alien universe in and of itself. Can you give any examples of the fully-fledged mainframe world differing from running it on x86/arm?
shawa_a_a··on Anytype: A local, privacy-first Notion alternative
This was exactly my thought. The title is 'A local, privacy first Notion alternative', but the site talks about

> can I own my piece of the new internet today?

Which screams 'digital assets'. Why do I need to 'own a piece of the new internet', why can I not just own... a set of notes on my machine?

The section which espouses the goals of the project smells similarly Web3

> We have a chance to end the nation state's monopoly on trust the same way as the printing press ended the church’s monopoly on truth.

Again like, I don't know how 'privacy-first Notion alternative' also somehow involves dismantling nation states.

Don't get me wrong, I'd love a free implementation of Notion (and by the UX of this landing page I don't doubt the developers have the resources and skills to do so), but I'd prefer that if this somehow involves digital assets and blockchains that it be front-and-center?

shawa_a_a··on Show HN: Life calendar – use the concept of Memento mori to embrace every week
I’ve recently incorporated exactly this into my journaling routine and find it a delight to look back on. At the end of the day I’ll be sure to write down one or two perfectly run-of-the-mill, but joyful things that happened to me, or that I noticed that day.

For example meeting a particularly friendly dog on the metro, a peculiar piece of graffiti, or just something a friend said that I found particularly funny.

It’s these small little moments that when stitched together over time that make up a “life well lived” in my opinion, much more so than setting large lofty goals or striving for doing “memorable” things.

shawa_a_a··on The Thought Emporium
I’ve only watched his WiFi video, as well as his Lactose Intolerance gene therapy and felt he cane across quite positively. Are you alluding to specific negative behaviours he exhibits on stream that are edited from his videos?
shawa_a_a··on Show HN: XP.css – Windows XP CSS file and framework for building GUIs
After using Windows 10 for a while I grew similarly fed up. I found OpenShell [1] to be a very faithful replication of the old start menu I'm used to from XP and before.

1: https://github.com/Open-Shell/Open-Shell-Menu

shawa_a_a··on Fat pointers in C using libcello
I don’t think you’re too far off with ‘leaving the space of normal C’, but I think it may help to see the context from which the author was coming when writing Cello [1] and evaluating it in that context.

It’s been a while since I watched the talk but I believe his intention was to do just that, to push the bounds of what could be done in a header file purely for the fun of it. The second half of the talk specifically addresses the “why are you doing this?” in quite a charming way.

1: https://youtu.be/bVxfwsgO00o

shawa_a_a··on Facebook to change user terms, limiting effect of EU privacy law
What aspects of the law are disastrous for startups? What startups might see as a "massive regulatory burden", I see it as, at long last, a means of finally holding irresponsible companies to account.

The spirit of the law is really quite simple; my personal data is an extension of me, and if you want to store or process it, you need a legal basis for doing so, and need to be able to demonstrate this legal basis to me. If your startup is at odds with this, well then perhaps you're not the kind of company the EU wants to be doing business with.

shawa_a_a··on Finding bugs in Haskell code by proving it
To throw another one onto the _have you looked at X_ pile, Microsoft Research has put a lot of effort into the Why3 theorem proving platform, which is the backend for the verifier built into their (experimental?) verifier-aware, imperative language, Dafny[1]. It feels very much like writing C#/Java but with verified pre/post conditions, loop invariants etc.

I took a formal verification course in college that involved writing several verified sorting, search etc. algorithms in Dafny [2]. I remember it being somewhat cumbersome to write your assertions in a way that the checker can check them, but it's looks very much like what you're suggesting.

(At the time I didn't realise that not only does the checker check the program, but compiles it into a CLR-compatible binary, hence you'll see equivalent C code for comparison)

[1] https://github.com/Microsoft/dafny [2] https://github.com/shawa/formal-verification-project