2,216 karma · joined Apr 17, 2014 (12y ago) · 266 submissions
comment 11mo ago · link · parent
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'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
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
comment 2y ago · link · parent
Something cool the web can do is static, reliable, easily readable documents – might be nice to show that off.
comment 3y ago · link · parent
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 4y ago · link · parent
comment 4y ago · link · parent
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
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
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
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
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
`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
comment 4y ago · link · parent
comment 4y ago · link · parent
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
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
> 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
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
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
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
> 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
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