Better HN
topnewbestaskshowjobs
Log inSign up

90s_dev

1,788 karma · joined Mar 13, 2025 (1y ago) · 921 submissions

Submissions

comment 1y ago · link · parent

Matt, who works pretty high level on VS Code, has written some amazing plugins.

But they still don't have all the first-class features of JSX.

I don't think this plugin works with type checking for instance.

comment 1y ago · link · parent

JSX supports

* Autocompletion

* Type checking

* Syntax highlighting

* Lack of runtime string parsing

Tagged template literals don't.

comment 1y ago · link · parent

Yeah he talks about how it was a choice he made simply so he could get stuff done and have some end in sight.

comment 1y ago · link · parent

It's not that they're hard to understand, it's that they're much denser. From Factor's examples page:

> 2 3 + 4 * .

There's a lot more there to mentally parse than:

> (2 + 3) * 4

It's the same as when Rob Pike decries syntax highlighting. No, it's very useful to me. I can read much quicker with it.

It's the same principle behind how we use heuristics to much more quickly read words by sipmly looking at the begninnings and ends of each word, and most of the time don't even notice typos.

comment 1y ago · link · parent

Popularity comes from utility. Utility comes from the right trade offs. Limitations demand careful trade offs.

comment 1y ago · link · parent

- 320 x 180 screen size for starters

- Limited map size

- Limited color palette I think

- and more!

comment 1y ago · link · parent

  const o = {}
  o["foo"] = function(){}
  o["foo"]()
  let key = "foo"
  o[key]()
  key = Symbol.dispose ?? Symbol.for('dispose')
  o[key]()
  o[Symbol.dispose]()

comment 1y ago · link · parent

Limitations demand and produce extraordinary creativity. That's the secret behind pico8 and Animal Well and so many amazing games.

I wish I didn't think of a significantly better architecture for my 2d-pixel-art-game-maker-maker this weekend. Now it'll be another month before I can release it :(

639.

Animal Well taps into PS5 hardware to elevate 2D pixel-art platforming(blog.playstation.com ↗)

3 points · by 90s_dev · 1y ago · discuss

comment 1y ago · link · parent

JSX is my favorite thing to come out of Facebook (also the only good thing).

comment 1y ago · link · parent

Using is more flexible, since it doesn't need a function call, but can simply assign a variable that implements [[dispose]]

comment 1y ago · link · parent

When I discovered this feature, I looked everywhere in my codebases for a place to use it. Turns out most JS APIs, whether Web or Node.js, just don't need it, since they auto-close your resources for you. The few times I did call .close() used callbacks and would have been less clean/intuitive/correct to rewrite as scoped. I haven't yet been able to clean up even one line of code with this feature :(

comment 1y ago · link · parent

Lisp I can understand to some degree... but writing Forth for a living? I know about 20-30 languages, but that one is Greek to me.

comment 1y ago · link · parent

For starters, your code is so full of serious syntax errors that in some places it's not even close to valid JavaScript. This is my best guess reconstruction:

    (async (e) => {
      await doSomething()
      while (!done) {
        ({ done, value }) = await reader.read()
      }

      promise
        .then(goodA, badA)
        .then(goodB, badB)
        .catch(err => console.log(err))
        .finally(() => {
          using stack = new DisposableStack()
          stack.defer(() => console.log('done.'))
        })
    })()
But more importantly, this isn't even close to anything a reasonable JS dev would ever write.

1. It's not typical to mix await and while(!done), I can't imagine what library actually needs this. You usually use one or the other, and it's almost always just await:

    await doSomething()
    const value = await readFully(reader)
2. If you're already inside an Async IIFE, you don't need promise chains. Just await the stuff as needed, unless promise chains make the code shorter and cleaner, e.g.:

    const json = await fetch(url).then(r => r.json())
3. Well designed JS libraries don't usually stack promise handlers like the {good,bad}{A,B} functions you implied. You usually just write code and have a top level exception handler:

    using stack = new DisposableStack()
    stack.defer(() => console.log('done.'))
    try {
      const goodA = await promise
      const goodB = await goodA
      const goodC = await goodB
      return goodC
    }
    catch(e) {
      myLogErr(e)
    }
    // finally isn't needed, that's the whole point of DisposableStack
4. We don't usually need AIIFEs anymore, so the outer layer can just go away.

comment 1y ago · link · parent

There's just something more polished, aesthetic and functional about the choice of limitations pico8 offers, whereas tic80 encourages decision paralysis.

comment 1y ago · link · parent

I've never had an issue with =nil being delete. What problem does it cause?

comment 1y ago · link · parent

Well of course you can trick people who aren't familiar with its syntax. But people who are see that this is

    local print = print("hello"):format()

    local foo = func("args to func"):itreturnedatable("!")
And I'm sure they can guess that that does.

comment 1y ago · link · parent

This sounds like it could compete with V8 at some point in the next few years. Honestly it could be a game changer. Looking forward to watching its progress.

comment 1y ago · link · parent

Ha! Called it again!

But why gotos instead of proper control flow? Is it just easier to emit?

comment 1y ago · link · parent

That's really exciting work. Great job. Hope it's fulfilling.

comment 1y ago · link · parent

No it was me who misunderstood you. And I kind of agree. I've never been a fan of tagged template literals. It gives you no autocompletion, no type checking, no syntax highlighting, nothing. And it requires a runtime string parser. I get why people like it, and maybe it's fine if you don't need those things and don't mind the cost of runtime parsing, but I need them and I do mind.

comment 1y ago · link · parent

That's actually really exciting in that case.

If it goes further and generates native C control flow statements when possible ("if", "for", native functions, native function calls, etc), I think it could be an omni-level language, generating basically Lua statements when dynamic and C when not, and mixing them all within the same program, entirely controlled by how much type information you give it (and how you use tables and metatables).

comment 1y ago · link · parent

`...` and fn`...` in JavaScript are just syntactic sugar for function calls, the former for array.join(...) and the latter for fn(...) so there's no issue with these utilizing the current scope since that's what all function calls do.

comment 1y ago · link · parent

Oh wait I know why. It's because the PIP had no specialized syntax highlighting to show that it was getting the variables from scope. So I started reasoning about it differently than I do about JS string literals, rather lazily too, and ended up thinking of something like emacs's dynamic scope or something. Amazing what syntax highlighting does to how we think.

comment 1y ago · link · parent

This visualization is breathtaking, thanks for making it.

Sometimes I want an excuse to write some Rust. I think I'll make one in my upcoming web app, since it already uses web workers. I guess the side effect is that wasm (and therefore Rust) will become a first class citizen in my app? Neat.

comment 1y ago · link · parent

Can I quote you when I finally release my app in a week or two?

comment 1y ago · link · parent

Wait, Pallene just compiles to C using whatever local C compiler?

https://github.com/pallene-lang/pallene/blob/master/src/pall...

Well that's kinda disappointing. I expected something more in 2025, like directly generating asm like a lot of languages are starting to do.

And your article makes it ambiguous whether it's from the Lua authors or grad students. I assume it started out just the students and then the Lua authors joined in?

comment 1y ago · link · parent

> Or they'll write to me and say, "how do I know if it's evil or not? I don't think it's evil, but someone else might think it's evil, so I'm not gonna use it."

> Great. It's working. My license works. I'm stopping the evildoers.

Or cautiously logical people who are probably doing good but don't have an absolute certainty that they are, which is probably the best way to live.

comment 1y ago · link · parent

> But lua isn't like that. It's not weakly typed like javascript - it's more akin to pythons dynamic duck typing system

What? No, Lua's type system is practically identical to JavaScript's.

Even metatables are extraordinarily similar to prototype chains via __index (though much more powerful since they allow for operator overloading, which I wish JS had).

comment 1y ago · link · parent

Now I'm on the fence about adding philosophy to software licenses, even if only in a joking way. It can be fun and even thought provoking, but it could get in the way of genuine business adoption for basically no return (you never know if it helps influence anyone for the better, and most likely it doesn't).
1
212223
31