HNHacker News
TopNewBestAskShowJobs

makuto

184 karma · joined September 30, 2020

Software engineer in the game industry.
submissionscomments
makuto··on Cakelisp: A performance-oriented Lisp-like language
That's true. I was mainly trying to indicate there is no boxing or anything like some languages seem to have with their types.
makuto··on Cakelisp: A performance-oriented Lisp-like language
There is a module in gamelib [0] which will automatically clone, build, and link raylib to your program. There are several other third party libs there as well, including SDL2 and Curl.

[0] https://macoy.me/code/macoy/gamelib

makuto··on Cakelisp: A performance-oriented Lisp-like language
Memory allocation matches C, i.e. malloc and free are used. If interoperating with C++, you can use new and delete.
makuto··on What they don't teach you about sockets
Author here! Isconnected is a hypothetical.
makuto··on NSFW Server Designation
Chat profanity filtering is usually part of Xbox/PlayStation certification requirements, so their hands might be tied on that.
makuto··on Ask HN: What are you surprised isn’t being worked on more?
I have a Surface Pro 2 running with the linux-surface kernel [0]. It feels like it has some rough edges - you have to decide between having pen support or having touch screen support, and suspend can be unreliable. These issues may be fixed now. Also, I encrypted my Windows partition, and now it requires the key each time to boot up, so I recommend against doing that.

Overall, I do agree that the hardware feels quite nice, and besides those issues I listed, the Linux experience is quite good. I was very happy to not be forced to use Windows.

[0] https://github.com/linux-surface/linux-surface

makuto··on Raytracing won't simplify AAA real-time rendering
I'm not sure why you say it's a "quite safe" assumption that most games are written in C#. Unity's beginner-friendliness gives it a disproportionate presence online, while the vast majority of AAA games are still solidly C++.

If we eliminate all games with less than 1000 sales or something, I think it would be a very low confidence estimate.

makuto··on Life Dashboard: Heads-up display for everyday life
I did something similar with a Raspberry Pi and Waveshare e-ink display: https://github.com/makuto/home-life-display
makuto··on Cakelisp: A Programming Language for Games
Yes, there's nothing in the language which is specific to games.

Once I get pure C output supported, it should be suitable even for embedded C environments.

makuto··on Cakelisp: A Programming Language for Games
That's correct. My goal wasn't to make a CL-compatible Lisp. I imagine the code will start to look less like C as more macros/generators get added.
makuto··on Cakelisp: A Programming Language for Games
Thanks! I have a list of similar projects, I will add these! https://github.com/makuto/cakelisp/blob/master/doc/VsOtherLa...
makuto··on Cakelisp: A Programming Language for Games
Yes, they are compiled just like the final exe, only they become dynamic libraries that I load with libdl. On subsequent builds, they are loaded again, unless the macro changed.
makuto··on Cakelisp: A Programming Language for Games
While I can't speak for any experimental new garbage collectors, I did analyze the SBCL generational GC's implementation. I encourage anyone interested in performance to look over GC code and realize how much work they are doing.

That GC in particular has to stop the world, traverse the entire fresh heap, guesses whether something is even a pointer (and can guess wrong, causing a memory leak!), and does all this at arbitrary times, unless you do non-idiomatic things like manage your own memory in preallocated arrays, or use C/asm-powered memory mapped buffers [0].

Nothing comes for free, and some domains can't pay the price for GC (and choose to spend those resources elsewhere). Games, in my opinion, are largely still in that category.

[0] https://m.youtube.com/watch?v=S7nEZ3TuFpA

makuto··on Cakelisp: A Programming Language for Games
It looks like Cakelisp for Rust! I'll have to look at it in more depth. Thanks for the link!
makuto··on Cakelisp: A Programming Language for Games
The big distinction to me is that there is a final executable that eventually gets created, whereas Lisp programs can continue to generate code and self-modify at runtime.

Cakelisp differs from Zig in that arbitrary code modification is supported, which is a step closer to the modifiable environment of Lisps. Very few languages besides lisp allow you to do things like "iterate over every function defined and change their bodies, and create a new function which calls them". Zig does not support that. It's extremely useful for some tasks (e.g. hot-reloading code modification, mentioned in the article)

Jai isn't out yet, but I was inspired by many of the comptime ideas.

makuto··on Cakelisp: A Programming Language for Games
I agree. Templates make some tasks easy (type specialization and generic containers) but become tangled messes with other tasks (function bindings, serialization).

I used something similar to your technique for compile-time variable destruction. The compiler doesn't know the type, so a macro generates a callback which deletes a casted version. These callbacks are named with the type so they can be lazily added and reused.

makuto··on Cakelisp: A Programming Language for Games
Carp requires writing bindings to call C functions or use types. Additionally, code modification isn't possible in Carp.

When I say seamless, I'm going for as close as possible, I.e. it should feel even easier to use C from Cakelisp than from C itself. The build system especially makes this possible.

makuto··on Cakelisp: A Programming Language for Games
I do wish the C compiler was as fast as e.g. SBCL's compiler in terms of compile time, because multiple rounds of dependent macro compilation eats up a lot of time.

I think Lisps tend to optimize for throughput, but games have very strict latency requirements. Garbage collection pauses could cause frame pacing issues (not that C solves that completely, but it is at least not a built in disadvantage of idiomatic use of the language)

makuto··on Cakelisp: A Programming Language for Games
Yes! You can typedef types and function signatures.
makuto··on Cakelisp: A Programming Language for Games
Thanks! It is a bit different, and does require more typing, but I like how unambiguous it is. It also simplifies code modification by making type parsing and changing easier, because you can recursively unwrap multiple pointers, or pointer-ify things easily.
makuto··on Cakelisp: A Programming Language for Games
See also on /r/gamedev [0].

After years of dealing with points of frustration in C++ land, I've created my own programming language. It emphasizes compile-time code generation, seamless C/C++ interoperability, and easier 3rd-party dependency integration. It's like "C in S-expressions", but offers much more than just that.

I had a hard time trimming this article down because of how excited I am about the language. Feel free to skim and read more in the sections that pique your interest.

I don't expect everyone to love it and adopt it. I do hope that some of the ideas are interesting to fellow programmers. I found it eye-opening to realize how much better my development environment could become once I opened this door.

[0] https://www.reddit.com/r/gamedev/comments/kh1p0a/cakelisp_a_...

makuto··on The State of Linux Debuggers
I disagree. I was using WinDbg downloaded from the Microsoft Store (so it had the WPF or whatever UI), and it was unusable. (Note: I was using it on a very large project - 4mLOC with hundreds of first- and third-party libs; It's likely I could get some use out of it on a trivial program, but it just didn't get the "real" program; and no, I wasn't simply missing the PDBs).
makuto··on The State of Linux Debuggers
I think that the major problem is that gdb was never designed/suitable for graphical debugging. I use Visual Studio on C projects at work, and found it very interesting to find that Windbg actually has similar terrible usability as gdb. Gdb and Windbg were both command line interfaces originally, whereas Visual Studio has it's own debugger backend which was visual-first (afaik).

Really, VS is exceptional even in Windows land. I've tried RemedyDB, an attempted rewrite of debugging on windows, and found it useless. It had similar bugs to this article - no symbols, failure to attach, failed to bind breakpoints at all, failed to display variables.

I think it would be a huge project to replace GDB with a graphical-oriented debugger, but it would be worthwhile. If I were in charge, I'd make it a C lib that didn't come with a frontend. That way, the user can stay in their familiar editor and link the lib. (most programs should be able to use C libraries).

makuto··on Connections by James Burke (1978)
I disagree. I think the point of the show is to illustrate how technology progresses. You could say one piece of it is about how we are reliant on it, and not in control of it, but I'd say overall, the show is optimistic about technology and celebrates innovation.

Edit: The Wikipedia article [0] does have a good summary, which I think makes us both right: There are really a collection of theses, none of which in my opinion dominate the show, except possibly the unplanned nature of technological evolution.

[0] https://en.wikipedia.org/wiki/Connections_(TV_series)

makuto··on Google is giving data to police based on search keywords, court docs show
While you're at it, to help with this specific case, you could also get a local copy of OpenStreetMap. That way you can look up and navigate to addresses without touching the internet.
makuto··on Coinbase offers exit package for employees not comfortable with its mission
That's a pretty jaded view of the world. Most tech I would guess goes towards increasing value in the company: improving their offerings, making new technology which solves problems for people/companies, etc.

Very few people have the time and money to fund tech and engineering purely to influence elections. Most money coming in to tech is going to be from customers and investors, the latter being in interest of making money off of the business getting more customers.

Companies like Cambridge Analytica are a very very minute minority compared to the swaths of B2B, consumer tech, etc.

makuto··on Coinbase offers exit package for employees not comfortable with its mission
This comparison resonated with me especially once I've learned how "deep" political views are, similar to religious views. Jonathan Haidt's "The Righteous Mind" is about this. Preaching politics in the workplace will scratch the same nerves that preaching religion will - deeply held beliefs that can cause strong reactions to people who agree or disagree with them.
makuto··on Coinbase offers exit package for employees not comfortable with its mission
Assuming young white males think the same thing. They had to bring age, race, and sex in to decide what they assume the political beliefs are of the majority of the site.
makuto··on Coinbase offers exit package for employees not comfortable with its mission
Fight racism and stereotypes with more racism and stereotypes, that'll work.
makuto··on Coinbase offers exit package for employees not comfortable with its mission
I think the original blog post made a very important point: We may all agree that there are issues, but there is a lot of disagreement in how problems should be solved. For example, some think that you should solve problems with the system, through elections, bills, etc., while others think a violent revolution and communism is the only way forward.

Your position regarding thinking everyone who isn't political at work is naive or evil is not helping the problem. This is only alienating people who already find such aggressive and exaggerated statements wrong.