Hacker Newsnew | past | comments | ask | show | jobs | submit | xnacly's commentslogin

> We write a lot of TypeScript at Cloudflare. It’s the lingua franca of software engineering.

This scares me more than Im able to admit, typescript sucks and in my opinion its way worse than the more commonly used lingua franca of computing, which I would attribute to C. At least C can be used to create shared objects i guess?


“Typescript sucks” is not really a great reason.

Personally I haven't felt like Typescript has bought me enough over JavaScript to use it in contexts that I don't have to. I have to use TypeScript for work, and it's "fine", but I guess I haven't found that it helps all that much.

I'm not sure why; I guess it's because the web itself is already really flexible that I find that the types don't really buy me a lot since I have to encode that dynamism into it.

To be clear, before I get a lecture on type safety and how wonderful you think types are and how they should be in everything: I know. I like types in most languages. I didn't finish but I was doing a PhD in formal methods, and specifically in techniques to apply type safety to temporal logic. I assure you that I have heard all your reasoning for types before.


Well it does suck for a huge list of reasons but specifically disqualifying for being the lingua franca would be it being controlled by microsoft

Well it does suck, and it isn't really great for implementing performant developer tools, such as parsers, formatters and so on.

The performance is that bad that the typescript developers are rewriting the language itself in Go. [0]

Tells me everything I need to know about how bad typescript is from a performance stand point.

[0] https://devblogs.microsoft.com/typescript/typescript-native-...


That’s the lsp not runtime. Bun runs Typescript very fast. It’s a fantastic language and ecosystem.

I’ve just checked FFI in bun and it’s marked as experimental. There are great libraries in C/C++ world and FFI is kinda table stakes to use them.

Each syscall taking 15ms on top of the normal considered costly time taken for context switching to the kernel seems excessivly slow, no?


It’s fast in terms of a response from a LLM model - but it is part of the system I am quite active on at the moment to ensure it’s performant as possible


Well i do use banking and netflix on graphene os on my pixel 8a and everything works perfectly


Hi, no it doesnt, this example of course breaks using temporary registers used after the optimisation. But thats why peephole is a fallback to ir optimisation, since they are only local.

I honestly didnt think of this possibility while building the optimisation. Since constant folding is done as an ir pass i will remove the peephole pass, thanks for noticing :)


Im sorry i forgot to highlight the braces around (2+3)*(4-1);

Either way the parser isnt implemented yet and all ast examples for the compiler are hardcoded


xnacly.me


Your site is the second one I've seen using the JetBrains Mono typeface -really easy on the eyes, even when set light grey #eff1f5 on a very dark #07080d background.


I love jetbrains mono, together with go mono my favourite fonts


Assembly requires way more work than compiling to, say C. Clang and gcc do a lot of the heavy lifting regarding optimisation, spilling values to the stack, etc


Then you're stuck with the C stack, though, and no way to collect garbage.


I have a couple interpreters I've been poking at and one uses 'musttail' while the other uses a trampoline to get around blowing up the C stack when dispatching the operators. As for the GC, the trampoline VM has a full-blown one (with bells-and-whistles like an arena for short lived intermediate results which get pushed/popped by the compiled instructions) while the other (a peg parser VM) just uses an arena as the 'evaluation' is short lived and the output is the only thing really needing tracking so uses reference counting to be (easily) compatible with the Python C-API. No worries about the C stack at all.

I mean, I could have used the C stack as the VM's stack but then you have to worry about blowing up the stack, not having access (without a bunch of hackery, looking at you scheme people) to the values on the stack for GC and whatnot and, I imagine, all the other things you have issues with but it's not needed at all, just make your own (or, you know, tail call) and pretend the C one doesn't exist.

And I've started on another VM which does the traditional stack thing but it's constrained (by the spec) to have a maximum stack depth so isn't too much trouble.


really? you cant track and count your pointers in C? why not?


what a weird and mean comment, do better


> do better

Can you write replies without turning to the big book of HRisms?


No clue what that is, I dont talk to hr


the rust example is so far off being useful and file io seems completly dumb in this context


Real programs have to do IO and the C and C++ code runs faster while also doing IO.

What do you think they could have done better assuming that the IO is a necessary part of the benchmark?

Also good job to the Rust devs for making the benchmark so much faster in nightly. I wonder what they did.


> Assuming that the IO is a necessary part of the benchmark …

So make it significant, move giga like benchmarks game reverse-complement & fasta & …

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...


The file I/O is probably irrelevant, but the startup time is not.

The differences among the really fast languages are probably in different startup times if I had to guess.


What if we try to measure rather than guess :-)

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...


> differences among the really fast languages are probably in different startup times

Startup times matter a great deal.


This, lisp is perfect for representing arbitrary data, nesting is just another sexpr, easy to produce, easy to parse and easy to debug / reason about


When I did my degree, the years prior to mine had some flexibility choosing the implementation language for compilers class.

Lisp and Prolog were forbidden due to how easy the whole exercise would be.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: