Better HN
topnewbestaskshowjobs
Log inSign up

one-more-minute

2,216 karma · joined Apr 17, 2014 (12y ago) · 266 submissions

Submissions

comment 11mo ago · link · parent

http://mikeinnes.io/posts/advent-2025/

I've been working through advent of code using my own little compiler/language. It's in such an early state that some creative problem solving is required, not to mention the compiler bugs! But I'm very pleased to have it running interactively on my blog like this – I want to work towards some bigger notebooks in the style of explorable explanations.

comment 1y ago · link · parent

I'm working on a little hobby language that compiles to wasm: https://mikeinnes.io/posts/raven/

I've spent the last couple of months porting the compiler from Julia to TypeScript. That's nearly done, so I'm hoping I can post an interactive web demo next month!

comment 1y ago · link · parent

The author outlines a fair bit of the design thinking in this post [0].

What Datalog and co give you is the ability to do interesting program transformations. Mostly that's not because they are "declarative", if that means anything, but because they avoid all the little bits of non-determinism that imperative languages include. If you avoid those you're pretty much set. Coming from another angle, JAX [1] shows how you can do program transformations in Python with a relatively small set of semantic restrictions.

[0]: https://www.scattered-thoughts.net/writing/unexplanations-sq... [1]: https://github.com/jax-ml/jax

4.

Zest: a programming language for malleable and legible systems(github.com ↗)

56 points · by one-more-minute · 1y ago · 14 comments

comment 2y ago · link · parent

Even within HTTP services, (a) your TLS will not be end to end, so you have to be happy for Cloudflare to see your data and (b) they don't like you to use up all their bandwidth with media streaming or other large files. Tunnel is a great service but there are certainly reasons not to use it.

comment 2y ago · link · parent

I'm not against a tasteful flourish or two, but in safari the header of this blog stuck over the content as I scroll: https://imgur.com/a/TyU2h3t

Something cool the web can do is static, reliable, easily readable documents – might be nice to show that off.

comment 3y ago · link · parent

You need (a little) JS to run Wasm in the same way you need (a little) HTML to run JS; it's a hosted platform. JS handles loading and invoking the wasm code, and because it's close to a pure instruction set there's very little you can do without calling JS APIs, which in turn requires support code to translate across the boundary.

The WASI project specifies wasm-native APIs (modelled on posix) for running locally without JS, so you could imagine something similar for the browser. But the complexity of the DOM is forbidding.

I've not tried Emscripten hello world for a while, but I imagine it depends on things like optimisation level, dead code elim etc. In general to compile C code you'll need a malloc, string support and so on as you say. You can make the wasm file tiny if you lean on JS strings, but that increases the amount of support code again. Languages other than C will have an easier time reusing parts of the JS runtime (like strings or GC).

comment 3y ago · link · parent

I mean, the article's logic is effectively that you can break code without the type system helping or warning you. I don't think Hickey would disagree with this – it's arguably a point in his favour.

comment 4y ago · link · parent

A nice example, not currently available on Google fonts AFAICT, is 'Gilbert': https://www.typewithpride.com

comment 4y ago · link · parent

Monotropism is compelling for all the reasons the author gives, but it isn't without any loose ends. For example, stimming is a characteristic feature of autism; the authors of the original paper briefly describe it as a focus on activity, but people often fidget to help them focus on something else (eg reading or listening), so it's unclear how that fits with the theory. The same goes for other common experiences like meltdowns, shutdowns and autistic burnout, as well as the higher incidence of alexithymia, queerness, and issues of anxiety and depression, which aren't obviously related to narrow focus.

Very possibly the "autistic"/"allistic" labels refer to a mix of different underlying cognitive variables, monotropism being just one. Either way, the theory seems an important step forward.

comment 4y ago · link · parent

I dislike referring to WASM as a "stack machine" for this reason. It is useful to remember that the text format started out as a low-level lisp-y expression tree with local variables and nested control flow. It still basically is that, but with the AST syntactically flattened in a way that looks a bit like a stack machine. (Admittedly, multi-value and block returns have since made it trickier to recover the AST.)

Things like Forth or the JVM byte code are true stack machines: all locals can be on the stack, and the stack shape can vary at runtime (which in turn makes validation harder). I seem to be in the minority, but I think wasm is quite different and the distinction is useful to maintain.

comment 4y ago · link · parent

Epidemiologists study health at the population level in general, not just communicable diseases. So at least in that sense the "epidemi-" prefix isn't limited to infection. Is there any better term for a health issue with rapidly increasing prevalence?

A dictionary of medicine from 1882 suggests that common usage of the word has become more narrow, not less, and that there was some level of debate about the technical meaning [1]. Stedman's Medical Dictionary (1920) gives a more modern definition, "a disease attacking nearly simultaneously a large number of people", without restriction to infectious diseases.

[1] https://www.google.co.uk/books/edition/A_Dictionary_of_Medic...

comment 4y ago · link · parent

Must be because I learned some French as a kid, but I can't help reading the "oi" as a "wa" sound in this context. Probably not what the authors were going for.

comment 4y ago · link · parent

To expand on this, the switching argument is actually correct if you happen to know that the envelopes contain either {x, 2x} or {2x, 4x} dollars (where x = 50 or whatever), and you observe that A=100. These are effectively hidden assumptions of the argument.

If you wanted to, you could explicitly model all possible values of the envelopes, and all possible observations of A – and you'd get the right answer again, including in the case above. You just can't define A in a path-dependent way, and then treat it as having the same value in all paths.

comment 4y ago · link · parent

Right. I mean the original, paradoxical line of reasoning – "the switching argument".

I see that the article also says "commonly one writer proposes a solution to the problem as stated, after which another writer shows that altering the problem slightly revives the paradox." But it doesn't seem to elaborate on where the simple resolution falls down, if it does.

comment 4y ago · link · parent

This line of reasoning isn't possible if you have specific amounts (eg £50 and £100) for the envelopes, which suggests that the variable A is being misused somehow.

`B = (2A if A=50, A/2 if A=100)`. Simplifying this to `B = 2A or A/2` loses important information: namely that when B is smaller, you expect A to be larger. Or alternatively, treating A as fixed (say A=100) conflates two different situations: one where the amounts are `100, 200` and one where they are `100, 50`. So you end up thinking B must have (200+50)/2 in it, which is incoherent. If you compute the expected B correctly then `A` is different in each branch.

It is subtle though. If this appeared in a paper, arguing something not obviously wrong, it'd be hard to convince everyone that the reasoning is bad.

comment 4y ago · link · parent

There's a proposed standard for embedding DWARF debug info in WASM binaries [1], which at least Chrome already supports. This is the same format native executables use, so it should put wasm ahead of other VMs in terms of source language independence. Dwarf seems to be the best thing we have, even if it's not renowned for its ease of use.

[1] https://yurydelendik.github.io/webassembly-dwarf/

comment 4y ago · link · parent

Right. It's important to remember that tools like JAX and PyTorch have total control over the numerical libraries they are differentiating, and have freedom to impose whatever semantics, rules and restrictions are convenient (immutability and referential transparency in JAX, for example). Seemingly small decisions in an existing language and library can have a big impact on the feasibility and practicality of AD.

comment 4y ago · link · parent

It might be useful to separate the issues that are "just" bugs from the problems that come with Julia's unusual level of composability. I have no idea if Julia has more bog-standard, local bugs – things like data structure problems or compiler faults – than other languages of comparable maturity and resources, but clearly the OP has bumped into several, which is frustrating.

The composition bugs – as in offsetarrays or AD – are a bit of a special case. In most languages package A will only work with package B if it's specifically designed to, and the combination will be explicitly developed and tested. That A and B can work together by default in Julia is really cool, but it also means that as you add new types and packages, you have a quadratically growing set of untested edges.

The canonical solution is strict interfaces. But Julia is laissez faire about those too (with some good reasons). Together this means that if A doesn't work with B as expected, it's not always easy even to assign fault, and both might be reluctant to effectively special-case the other. Program transformations (autodiff) compound this problem, because the default is that you promise to support the universe, and it's not easy to opt out of the weird cases.

I think it's absolutely right to celebrate Julia's approach to composition. I also hope new research (in Julia or elsewhere) will help us figure out how to tame it a bit.

comment 4y ago · link · parent

Rust and Go seemed to initially want to target C programmers [1], but ended up capturing users from higher level languages – even Python and such – who wanted better performance and more control, because they had so many affordances.

Hare clearly isn't like that: it's _actually_ aimed at (FOSS) C programmers, almost stubbornly so, and isn't going to appeal to many others. But for those people I can see C-with-tagged-unions being an improvement, and there's value in finding the minimal diff that makes a language better.

[1] Remember when Go called itself a "systems programming language"? Neither community seems to use this phrase any more, though.

comment 4y ago · link · parent

Do this enough and you get a superpower (or at least a neat party trick): you can translate ideas across field boundaries and find really interesting links between subjects. Even just observing that some idea X has been discovered by fields A and B is, I think, really valuable, because so few people cross subject boundaries, and there are often wide terminology gaps that prevent ideas from cross pollinating.

> I like writing and can imagine having some sort of blog, but that's seems so cliche?

Writing on blogs might be commonplace. Good writing is not. Spend a little time thinking about writing well and you'll be ahead of the crowd.

That said, I don't think you should worry too much about how other people will see your writing. I treat my blog as a sort of public notebook. The articles are primarily for me; they are what I'd want to have read if I hadn't done the research myself, and/or a year later when I've forgotten everything. That takes off the pressure to be perfectly original or polished.

comment 4y ago · link · parent

Cool! If the author is reading, have you looked at synaesthesia, and do you think it applies here? The idea of addition having both a visual appearance and a kinetic feel is alien to me (perhaps partly because I avoid mental arithmetic like the current plague). But it's apparently reasonably common to have colour and spatial associations with numbers.

I'm also curious if you are an unusually quick calculator compared to others you know. Synaesthetes can sometimes turn their condition into a talent, like the famous Shereshevsky who had a photographic memory; every experience was utter sensory overwhelm, making mundane information very memorable.

comment 4y ago · link · parent

In general the gov.uk website is stellar. Lots of good info, and plenty of thought has gone into making everything clear, accessible and pleasing to the eye. Things generally work in a way that they really don't on most public org websites. The team behind it blog a fair bit about how they've made these things happen.

https://insidegovuk.blog.gov.uk

The only downside is that they often send you to sites run by other, significantly less competent bodies (looking at you, student loans company).

comment 5y ago · link · parent

Being explicit about side effects in the type system isn't a bad idea, but don't conflate that with blocking/non-blocking operations. Some side effects aren't async (eg console.log in JS, mutating shared state) and some pure functions are (eg GPU linear algebra operations).

Effect systems (as in Koka) are mentioned elsewhere; arguably their major innovation is being explicit about effects without sacrificing composability. Functions are only "coloured" by the type system, rather than syntactically, and can be coloured differently depending on context. This is quite different from the async/await situation.

comment 5y ago · link · parent

Some interesting psychology here:

> In one study, each participant was given $25 and asked to place even-money bets on a coin that would land heads 60% of the time. Participants had 30 minutes to play, so could place about 300 bets, and the prizes were capped at $250.

> Remarkably, 28% of the participants went bust, and the average payout was just $91. Only 21% of the participants reached the maximum. 18 of the 61 participants bet everything on one toss, while two-thirds gambled on tails at some stage in the experiment.

26.

Letterlocking: Origami in Reverse(economist.com ↗)

2 points · by one-more-minute · 5y ago · discuss

comment 5y ago · link · parent

Tangential question about FPGAs: Is there any work on compiling code to a combination of hardware and software? I'm imagining that the "outer loop" of a program is still fairly standard ARM instructions, or similar, but the compiler turns some subroutines into specialised circuits. Even more ambitiously you could JIT-compile hot loops from machine instructions to hardware.

We already kind of do this manually over the long term (eg things like bfloat16, TF32 and hardware support for them in ML, or specialised video decoders). With mixed compilation you could do things like specify a floating point format on-the-fly, or mix and match formats, in software and still get high performance.

28.

WebAssembly on Roku(motley-coder.com ↗)

3 points · by one-more-minute · 5y ago · 1 comment

comment 6y ago · link · parent

See also Piet: https://esolangs.org/wiki/Piet
12345
9