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

Would wasmtime be a good general purpose scripting extension layer for a C program in the style of embedded Lua but faster and more generic? Is that a reasonable use-case?

comment 1y ago · link · parent

> Applications controlled multitasking. The apps would signal to Windows that they were sitting idle and another app could take over.

Wait a minute, you're saying we started with await/async, and moved away from it, and then back to it?

comment 1y ago · link · parent

Ah, fair enough. So it is still stringly typed, it's just verified at compile time. Which I guess is true about all compiled functions ever.

comment 1y ago · link · parent

If it's just a variable in scope, you could do:

  if (condition) {
    // new scope
    const jsx = // ...
    return <foo/>
  }
In practice, "variable in scope" is essentially the same as "global in scope" and React used to require you to import 'react' at the top of every JSX file for this reason. Your solution is tantamount to just changing that to import jsx from 'react' but still requiring it explicitly.

The main problem with this is that it's non-trivial to make sure variables are in scope before/while loading a file, and they should be loaded on an as-needed basis instead of always, which is what inevitably ends up happening when you need React classic, you import React at the top of every HTML file. These problems seem to be what led to auto-imports.

I admit that my solution still does require you do something like import interpretJsx from 'something', and even further it requires you to manually call interpretJsx(<foo/>) which can be tedious and verbose.

The main benefit is that at least it becomes a standard. And besides, we probably won't need to call those functions everywhere, just at the top of a tree, like the same place you call React.render(root)

The main downside is lack of monomorphism, especially if you're passing an entire tree to interpretJsx(). I admit this is not solved by my proposal. But I still wanted to put the proposal out before smarter eyes than mine anyway.

comment 1y ago · link · parent

How is that not also stringly typed?

comment 1y ago · link · parent

Yeah it seems fine. I wouldn't be strongly opposed to it. Standardization of either is better than nothing.

comment 1y ago · link · parent

True, but those were designed in the 80s or 90s. I guess I'm thinking of embedded scripting languages designed since ~2015.

comment 1y ago · link · parent

I don't think that's the reason behind Lua's syntax. I think it was designed specifically to be extraordinarily unambiguous, clean, and simple, which it is.

comment 1y ago · link · parent

A few times over the past 15 years, the HN mods have made it clear to me that you only get the HN spotlight once every few months. So this was my one chance for mid 2025 to release it right. That's okay, lesson learned is the important thing. I'm moving on to the next big iteration of it and will probably post again in Q3/Q4.

comment 1y ago · link · parent

Fun story, I once walked about 11 hours because of my stupidity, and at the end my heart wouldn't stop racing even after I passed out in a bed. I woke up a few times with my heart still racing, and that whole day and night I wasn't sure I was going to make it. Don't repeat my mistake. Don't walk too much.

comment 1y ago · link · parent

> I once tried to burn 3,000+ calories per day using just walking.

You'll generally burn about ~2k cals per day just being alive. An intense workout for an hour can burn maybe 500 on top of this. I think your math might be off somewhere if you walked a lot and figured that you spent a whole 1k.

comment 1y ago · link · parent

> Note that nothing in the script is run automatically when the script is loaded, as happens in many other scripting language. The host application decides which functions and filtermaps it extracts from the script and when to run them.

So it's closer to something like C or C++, where it just defined stuff and you can choose what to use? I guess that's fine when there's no initialization for the script to do. Maybe in your domain that's never the case. But many languages end up adding static initialization as a first-class feature eventually.

comment 1y ago · link · parent

> Finally, we want a language that is easy to pick up; it should feel like a statically typed version of scripting languages you're used to.

It looks like Rust. All Rust scripting languages do. Is this true for all other languages? Is this just a property of embeddable scripting languages, they will always resemble the language they're implemented in and meant to be embedded in?

comment 1y ago · link · parent

Interestingly, Ghostbusters (1984) was rewritten to have the team being a startup, because everyone was beginning to start up their own businesses at the time.

comment 1y ago · link · parent

> *It's NOT a proposal to incorporate JSX into the ECMAScript spec itself.* It's intended to be used by various preprocessors (transpilers) to transform these tokens into standard ECMAScript.

(Emphasis theirs.)

comment 1y ago · link · parent

True. Then can you suggest a standardized ECMAScript JSX proposal that doesn't turn this into a "children" key on an object? Would you just transform it into an array? ["foo", { bar: qux }, "baz"] ?

comment 1y ago · link · parent

Hi, I'm the guy who wrote this proposal.

tl;dr:

My proposal transforms <foo bar={qux}>bla</foo> into { [Symbol.for('jsx')]: 'foo', bar: qux, children: "bla" }

It's self-contained, generic, doesn't rely on imports or globals, and avoids tag key collisions. It's the only way I can imagine it ever being standardized.

I currently use JSX for:

* Creating custom GUI view objects in https://90s.dev/os/

* Using JSX as a convenient & composable string-builder in Node.js via https://immaculata.dev/ when generating all my sites at build-time e.g. https://github.com/sdegutis/immaculata.dev/blob/main/site/te...

* Using JSX to generate plain DOM objects in the browser in some of my sites like https://github.com/sdegutis/minigamemaker.com/blob/main/site...

comment 1y ago · link · parent

This is a known ambiguity in JSX, to the point where TypeScript gives this error:

> 'children' are specified twice. The attribute named 'children' will be overwritten. ts(2710)

comment 1y ago · link · parent

Then is the solution to have write-only be the default for muts, so that they start out write-only at least, but can also be made to be read-write either (a) in given circumstances of creation, or (b) after certain operations on them, or (c) if created by certain APIs?

comment 1y ago · link · parent

Given <foo bar={qux}>bla</foo>

React used to transform it into React.createElement("foo", { bar: qux }, "bla")

Now it transforms it into import _jsx from "react/jsx-runtime"; _jsx("foo", { bar: qux }, "bla")

My proposal transforms it into { [Symbol.for('jsx')]: 'foo', bar: qux, children: "bla" }

It's self-contained and generic, doesn't rely on auto-imports or globals, and doesn't have key collisions.

It's the only way I can imagine it ever being standardized.

comment 1y ago · link · parent

I made this proposal because JSX is more generally useful than generating HTML. You can use it for configuration, or views for other GUIs like I do in https://90s.dev/os/ or to describe basically any kind of tree.

comment 1y ago · link · parent

Well?? Did it sign it???

comment 1y ago · link · parent

There is a difference though between showing off cool stuff and having the potential to show off cool stuff. I released my app in the latter phase, not the former, which is what I wanted to do. To be honest, I was just having a really bad day yesterday and was feeling really burnt out, so I just sort of gave up and released it, knowing full well I hadn't written the stuff to show off how cool this is just yet. I knew I should have waited. Oh well, lesson learned.

comment 1y ago · link · parent

Sorry, what? Did you just say NASA uses Clojure?? That must be a pretty big honor for Rich.

comment 1y ago · link · parent

Interestingly, I didn't know Vue had a thing called a Ref until about a week ago. Yet my Refs have a very similar design. Though I do think my Refs are much better and more generally useful.

In fact, I think my Refs might be a genuine breakthrough in compsci, mainly because of .defer(), and I half want to write a doctoral thesis on them just to see if anyone else agrees.

comment 1y ago · link · parent

> Assertions for programmer mistakes; errors for user mistakes

That's been the general mantra for at least a decade or two. And I think it's right.

comment 1y ago · link · parent

Write into uninit'd buffers was one of the pain points of Rust for the creator of the new open source "edit" program for Windows[1]. I wonder what he thinks of this article.

> Another thing is the difficulty of using uninitialized data in Rust. I do understand that this involves an attribute in clang which can then perform quite drastic optimizations based on it, but this makes my life as a programmer kind of difficult at times. When it comes to `MaybeUninit`, or the previous `mem::uninit()`, I feel like the complexity of compiler engineering is leaking into the programming language itself and I'd like to be shielded from that if possible. At the end of the day, what I'd love to do is declare an array in Rust, assign it no value, `read()` into it, and magically reading from said array is safe. That's roughly how it works in C, and I know that it's also UB there if you do it wrong, but one thing is different: It doesn't really ever occupy my mind as a problem. In Rust it does. [https://news.ycombinator.com/item?id=44036021]

508.

Proposal for Standardized JSX(vanillajsx.com ↗)

35 points · by 90s_dev · 1y ago · 45 comments

comment 1y ago · link · parent

Thanks.

I failed to capture the essenence of what my project is. The APIs are really what's exciting. But you can't see APIs, they're like the wind, you have to see them in action, through their side effects. I should have waited until I had made more things that show off how innovative these APIs are. I released it too soon.

comment 1y ago · link · parent

> No. I achieved this because the code contained very little of the real value. That was all stored in my head. The design was in my head, and with hindsight I could see all its flaws. I was therefore able to create a much more efficient and effective design based on that learning.

Exactly. Code is cheap to write. Even a lot of it. What's hard is understanding a problem thoroughly enough to model a correct solution. Once you have that, you've done 90% of the work.

1
161718
31