HackerTrans
TopNewTrendsCommentsPastAskShowJobs

ctxcode

no profile record

Submissions

Show HN: Valk programming language with a stateful GC

github.com
2 points·by ctxcode·há 5 meses·0 comments

comments

ctxcode
·há 5 meses·discuss
That's so awesome :D thanks for making this. amazing.
ctxcode
·ano passado·discuss
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.
ctxcode
·ano passado·discuss
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.
ctxcode
·ano passado·discuss
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.
ctxcode
·há 2 anos·discuss
Sounds like this is going to cost alot of money. (more than it should)
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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 ^_^
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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.
ctxcode
·há 2 anos·discuss
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.