News for hackers. Stuff that matters.

ctxcode

Show HN: Valk programming language with a stateful GC

https://github.com/valk-lang/valk

Hello everyone. I want to show you the Valk programming language. It focusses on simplicity and performance. It has a stateful GC, which i think hasn't been done before. I would like your feedback. Note we are still working on more features, it's not the complete/final product. If you like the project, join our discord (link in GitHub).

( Read More... | no comments | on HN )
Re:Hackers (1995) Animated Experience on Friday February 06, 2026 @07:28PM (#46920023)
That's so awesome :D thanks for making this. amazing.
Re:Mark Cuban offers to fund former 18f employees on Sunday March 02, 2025 @11:38AM (#43232156)
Private companies are required to do a good job and balance spending to stay alive. Goverment agencies can do the most horrible job for enormous amounts of money and just keep going.
Re:Mark Cuban offers to fund former 18f employees on Sunday March 02, 2025 @11:22AM (#43232009)
Non profit: Every dollar not spent on patient can be donated a NGO and then laundered into your own pockets.

For profit: While company A keeps the profit, company B lowers its prices instead. Now customers are going to company B instead of A.

Im not saying that this is how it's done, but in the real world, things are not that simple.

how i've used git every day in the last 10 years:

git add -A, git commit -m, git push

If there's an error because there are changes on the remote, type:

git pull, fix conflicts in case there are any, repeat previous commands

In all other cases, google/grok for the solution, doesnt happen often.

Sounds like this is going to cost alot of money. (more than it should)
serverless just means that a hosting company routes your domain to one or more servers that hosting company owns and where they put your code on. And that hosting company can spin up more or less servers based on traffic.. TL;DR; Serverless uses many many servers, just none that you own.
Re:Tracing Garbage Collection for Arenas on Thursday June 27, 2024 @12:13PM (#40812115)
We dont have static arrays for GC types. Creating multiple objects is always 1 by 1 and we would put them in a dynamic array. We do support non-GC structs, which allow you to create static arrays in a single allocation. I havent spent much time on this problem yet. I might figure it out in the future, but it's kinda low-priority for me.
Re:Tracing Garbage Collection for Arenas on Thursday June 27, 2024 @11:21AM (#40811512)
Interesting article. 16-24 bytes per allocation is pretty big and it sounds like it would a bit too much overhead, an actual demo would be nice.

My approach with Valk is to allocate per type size and in incremental sized blocks. These blocks work alot like tiny bump allocators and can be reset with 1 line of code without losing the objects in it that are still used.

If the overal memory usage increased a certain percent, we trace the stack, clean up the blocks from long existing objects and free blocks that are completely empty.

My benchmark performes 2x faster than rust, and 4x golang. We use 8 bytes per allocation.

Re:Htmx 2.0.0 has been released on Monday June 17, 2024 @04:26PM (#40710660)
i havent used htmx yet, but it sounds like a breath of fresh air. no npm library with 1000 dependencies with slow build times. just plain simple js library like the good old days ^_^
Re:Leveraging Zig's Allocators on Saturday June 15, 2024 @02:35PM (#40691716)
If you never cache any data. Sure, u can use a bump allocator. Otherwise it gets tricky. I havent worked with actors really, but from the looks of it, it seems like they would create alot of bottlenecks compared to coroutines. And it would probably throw all your bump allocator performance benefits out the window. As for the GC thing. You cant 'just' call a GC.. Either you use a bump allocator or you use a GC. Your GC cant steal objects from your bump allocator. It can copy it... but then the reference changes and that's a big problem.
Re:Leveraging Zig's Allocators on Saturday June 15, 2024 @12:31PM (#40690770)
These kind of tactics work for simple examples. In real world http servers you'll retain memory across requests (caches) and you'll need a way to handle blocking io. That's why most commonly we use GC'd/ownership languages for this + things like goroutines/tokio/etc.. web devs dont want to deal with memory themselfs.
Re:The search for easier safe systems programming on Wednesday May 08, 2024 @02:33PM (#40301450)
If you change the language, you have no ecosystem. You cant say, it has a big ecosystem "if everyone ports their code". By that logic all languages have a big ecosystem. Anyhow. JS has much unexpected strange behaviour, i really would not recommend such a language in 2024.
I stopped reading news in the last 3 years and i havent had one "damn, i didnt know about that" moment. News is truelly unimportant.

As for "nowadays there's no difference between those 2 things". I think the "nowadays" part is wrong. I think people have been like this since the beginning of mankind. Just look at medieval witchhunts or ww2 germany.

However, i think the it's an interesting story. It kinda revolves around the philosophy about what is "true". I cant answer that though, but it's interesting to think about.