Lua is very flexible and very fun to hack! With a different approach [0], you can get a switch on tag that feels more like a "standard" switch statement, eg.:
result = switch(shape) {
rectangle = function(r)
return "a rectangle with width " .. r.width
end,
function(s)
return "an unknown shape"
end
}
Can't easily get rid of the pesky functions, though.
(Implicitly) using [1] instead of [false] as a default is less typing for sure (but maybe a bit more confusing?).
Also, objects being switched on really have to be tables in my version anyway (since overriding __call for builtin types seems harsh to me), so having a tag field right in them as opposed to creating a metatable should be more efficient.
For my version I'll add a value-weak map of metatables to dedup them, should work as well.
In terms of functions, yeah, I don't think you can get rid of them, but (in the example) you can avoid (r) and (s) params if you assume that the functions lexically close over shape.
I love that this is on today's internet, and as its own site, not as an account in somebody's garden. Uniquely tailored to what it is trying to do and oozing with personality, but professional in presentation.
I have zero interest in mushrooms or dying fabrics, and yet, I can't help and be infected by this site's enthusiasm. Great way to start a day!
If you find this interesting and find yourself in Berlin with a bit of free time, the Deutsche Techniksmuseum there has a great exhibit on Zuse, including replicas, actual units of later computers, design drawings, storage units... well worth your time (as is the rest of the museum).
The GBA still had some cartridges with enhancement hardware, though a lot less focused on overcoming CPU/memory limitations than on the previous consoles.
My favorite is WarioWare: Twisted [1] including a gyro sensor (+ a rumble pack) to enable gameplay based on turning the whole GBA around. But there were also add-on real time clocks (Pokemon), light sensors, and other things.
It also had the Nintendo e-Reader [2], which technically connected to the cartridge port and loaded like a cartridge, but was its own unique piece of weirdness.
I like the Play-Yan adapter. It's an official media player which includes its own DAC and headphone jack, avoiding the GBA's own disappointing audio DAC. It also adds hardware decoding[1] - the GBA's CPU is a little too puny to handle media playback by itself.
I had forgotten about the eReader. I had gotten Excitebike on the eReader card because I was curious. I was planning on getting an eReader at some point, but never got around to it.
As a game developer, I find eased tweens with a preset duration better for most UI use cases. However, this other type of animation is extremely useful when you want to smooth a movement that is continuous/unpredictable, with no definite start/end point. Think for example a tile being dragged-dropped on a grid, snapping to the grid as the player moves the mouse, or indeed, the article's example of moving a camera around.
For these cases, the exponential lerp trick is very useful, and not universally known. There are many games (some of mine included!) that use the less correct linear lerp and run into trouble with their animations feeling completely off once somebody runs the game on a 240 Hz monitor, or anything different from the 60fps that used to be standard.
For this reason, I appreciate the article. It's usually hard to access this type of hyper-specific knowledge, as it is most often passed as an "apprentice-style" oral tradition from the senior people on a team to the more junior members.
I know it's partly on me for not knowing the domain, but I honestly suspected somebody is trying to make fun of me with some concentrated technobabble.
Especially since I wouldn't expect the topic (configuration languages) to require complex mathematical machinery to work with. Now I have something interesting to dig into.
What has most impressed me about GraalVM and Truffle is their capability of deep-optimizing high-level code like Python and Ruby.
I once saw a demo where someone took a simple operation in Ruby using inefficient-but-elegant syntax (including creating and sorting an array, where a simple loop would have been the appropriate approach in C). He compiled that using TruffleRuby and the entire array construction and sorting was completely optimized out of the generated bytecode.
Glad I'm not the only one who had this reaction. I just can't bring myself to accept that a problem that could be solved with a slightly better version of JSON or property lists requires this many buzzwords.
Those aren't "buzzwords" though, it's a very specific way to implement programming languages. It's not really meaningful except for the PL implementation nerds.
Especially the Futamura projections. It's almost magic and very few people have even heard of them.
Very few people have heard of them. That is exactly the reason why I mention them as often as I can. They are a great entry into the world of meta compilers.
If Futamurma means what I think it means skimming across the Wikipedia entry, it would mean that simple value-holder-file configurations would be parsed and checked at the speed of a general purpose tokenizer. But without closing the door to what the language can express in more elaborate configuration file "landscapes". Best of both worlds and presumably all without requiring anybody but the toolmakers to understand what the buzzwords really mean.
>...suspected somebody is trying to make fun of me...
I think that too, "Futamura projections" are important but they are very very far from "complex mathematical machinery" as you may hear it. They are indeed very simple (even mathematically trivial) and require no special background to understand.
Are you really this upset because people don't know a 60 year old movie reference, and downvoted a comment that didn't add to discussion? And you need to flex your age because of it?
If you get this upset you don't have to post on this site. Or you can learn to be not as reactive to social media.
>Are you really this upset because people don't know a 60 year old movie reference, and downvoted a comment that didn't add to discussion?
Maybe you should read more carefully before replying.
I already said above that I was not complaining.
As for my comment (the supercali... word) not adding to the discussion, you are wrong again. The comment was in the same spirit as my parent and grandparent comments, who used words like cromulent, embiggen and perfectumentous.
>And you need to flex your age because of it?
Wrong again. Nothing in my comment shows that I was "flexing my age", as you call it.
>If you get this upset you don't have to post on this site.
Oh, I don't mind posting. I am having fun. I don't let comments like the one that I replied to, spoil my fun.
>Or you can learn to be not as reactive to social media.
Er, the term is "social" media, not "lone wolf baying at the moon" media.
It indicates people reacting (by replying) to other people, which could include approvingly, neutrally or critically, just like in real life, you know.
But there is something in what you say. This "comments about comments about comments about ..." scenario is getting boring and tedious.
From now on, I'll let the blind downvoters be blind downvoters and keep doing their thing. As I said earlier, HN points are not at all important, to me, at least.
You joke but newer rails versions come with a front end framework named Turbo, and there's also a JS bundler named Turbo, so this is actually too close to reality
This comment is what PKL is going to be remembered for. Tbh I wouldn’t even have the courage to write the comment myself as the framework was coming from Apple.
I can already see the wonderful cyberpunk future, where people writing e-mails use Gmail's AI assistant to add all the polite boilerplate, while the recipients trying to get through their overflowing inbox use the Gmail-integrated AI summarizer to pare it all back down.
In fact, the Plus plan is being removed completely. It's only mentioned off-handedly in the last paragraph of the article, but it's another giant change for indie devs (who have no choice but to migrate from Plus to Pro).
They are offering a free upgrade from Plus to Pro for one year, but that does nothing once that time elapses - you have to pay the Pro fees or drop down to Personal, which is not viable for most games.
Do we have a good, objective benchmark set of prompts in existence somewhere? If not, I think having one would really help with tracking changes like that.
I'm always skeptical of subjective feelings of tough-to-quantify things getting worse or better, especially where there is as much hype as for the various AI models.
One explanation for the feelings is the model really getting significantly worse over time. Another is the hype wearing off as you get more used to the shiny new thing and become more critical of its shortcomings.
https://www.cgccards.com/news/article/13534/
History both repeats and rhymes, in this case.