←back to thread

jank is C++

(jank-lang.org)
252 points Jeaye | 6 comments | | HN request time: 0.697s | source | bottom
Show context
johnnyjeans ◴[] No.44535498[source]
I'm not surprised to see that Jank's solution to this is to embed LLVM into their runtime. I really wish there was a better way to do this.

There are a lot of things I don't like about C++, and close to the top of the list is the lack of standardization for name-mangling, or even a way mangle or de-mangle names at compile-time. Sepples is a royal pain in the ass to target for a dynamic FFI because of that. It would be really nice to have some way to get symbol names and calling semantics as constexpr const char* and not have to deal with generating (or writing) a ton of boilerplate and extern "C" blocks.

It's absolutely possible, but it's not low-hanging fruit so the standards committee will never put it in. Just like they'll never add a standardized equivalent for alloca/VLAs. We're not allowed to have basic, useful things. Only more ways to abuse type deduction. Will C++26 finally give us constexpr dynamic allocations? Will compilers ever actually implement one of the three (3) compile-time reflection standards? Stay tuned to find out!

replies(8): >>44535506 #>>44535588 #>>44535621 #>>44535873 #>>44535967 #>>44536143 #>>44539903 #>>44540443 #
benreesman ◴[] No.44535588[source]
Carmack did very much almost exactly the same with the Trinity / Quake3 Engine: IIRC it was LCC, maybe tcc, one of the C compilers you can actually understand totally as an individual.

He compiled C with some builtins for syscalls, and then translated that to his own stack machine. But, he also had a target for native DLLs, so same safe syscall interface, but they can segv so you have to trust them.

Crazy to think that in one computer program (that still reads better than high-concept FAANG C++ from elite lehends, truly unique) this wasn't even the most dramatic innovation. It was the third* most dramatic revolution in one program.

If you're into this stuff, call in sick and read the plan files all day. Gives me googebumps.

replies(3): >>44535907 #>>44536648 #>>44537532 #
no_wizard ◴[] No.44536648[source]
Carmack actually deserves the moniker of 10x engineer. Truly his work in his domain has reached far outside it because id the quality of his ideas and methodologies
replies(1): >>44538357 #
1. bitwize ◴[] No.44538357[source]
I have a bit I do where I do Carmack's voice in a fictional interview that goes something like this:

Lex Fridman: So of all the code you've written, is there any that you particularly like?

Carmack: I think the vertex groodlizer from Quake is probably the code I'm most proud of. See, it turns out that the Pentium takes a few cycles too long to render each frame and fails to hit its timing window unless the vertices are packed in canonically groodlized format. So I took a weekend, 16-hour days, and just read the relevant papers and implemented it in code over that weekend, and it basically saved the whole game.

The point being that not only is he a genius, but he also has an insane grindset that allows him to talk about doing something incredibly arcane and complex over a weekend -- devoting all his time to it -- the way you and I talk about breakfast.

replies(2): >>44538490 #>>44538744 #
2. ajkjk ◴[] No.44538490[source]
I like this word, 'grindset'
3. upghost ◴[] No.44538744[source]
Another weird thing about Carmack, now that you mention it -- and Romero, coincidentally -- is their remarkable ability to remember technical challenges they've solved over time.

For whatever reason the second I've solved a problem or fixed a bug, it basically autopurges from my memory when I start on the next thing.

I couldn't tell you the bugs I fixed this morning, let along the "groodilizer" I optimized 20 years ago.

Oh btw Jank is awesome and Jaeye is great guy, and also a game industry dev!

replies(3): >>44539334 #>>44539423 #>>44540766 #
4. mjevans ◴[] No.44539334[source]
I tend to (more easily) remember things that frustrate me but I overcome. Annoyance is a real factor in it.
5. benreesman ◴[] No.44539423[source]
I find it's actually a good guideline for what to work on. If I'm 1, 3, 6, 12 months into a job or some other project and I can't remember what I was doing X months ago it tends to mean that I'm not improving during that period of time either.

Carmack is always trying to get better, do more, push the envelope further. He was never in it for money or fame, he was in it to be the best near as I can tell. And he's still among the truly terrifying hackers you wouldn't want to be up against, he just never stopped. You get that with a lot of the people I admire and try to emulate as best I can, Thompson comes to mind, Lamport, bunch of people. They just keep getting more badass from meeting their passion to the grave, a lifelong project of unbounded commitment to excellence in their craft.

That's who I look up to.

6. whstl ◴[] No.44540766[source]
The trick for remembering those things is debriefing with other devs and then documenting. And then keep talking about it.

I don't do mind blowing stuff like Carmack but: just yesterday I came across a bug that helps supporting my thesis that "splitting methods by LOC" can cause subtle programmer mistakes. Wanna write a blog post about it asap.