HNHacker News
TopNewBestAskShowJobs

levodelellis

190 karma · joined June 12, 2022

submissionscomments
levodelellis··on Zig builds are getting faster
I don't remember, I grabbed a project that I can't remember the name of and compiled something else first to warm up the compiler then compile the project. I tried several times and it seemed to be consistently < 100K
levodelellis··on Zig builds are getting faster
I'd call it not terribly slow. IIRC it didn't hit 100k lines on an M2, while I saw over two million on my own compiler (I used multiple instances of tcc since I didn't want to deal with implementing debug info on mac)
levodelellis··on Zig builds are getting faster
Yes. I once was thinking I should write a x86-64 codegen for my own compiler, but using tcc I was able to reach 3 million lines in a second (using multi-threading and multiple instances of tcc) so I called it a day. I never did check out if the linking was in parallel
levodelellis··on VVVVVV Source Code
That took me a long time too. It was rewarding tho
levodelellis··on How I use Kate editor
I didn't heavily use undo trees so I don't remember how neovim/emacs displays it. I think I get it enough that if I try it out I'll be able to understand what you mean
levodelellis··on How I use Kate editor
Just a thought, do you want it as a tree? It seems like it'd make more sense if there was a bar or key you can press to go back and forward to the changes you want. I didn't really understand why having it as a tree was helpful.

I'm not going to say I wont implement it, I'm just saying I'm not understanding why you want it that specific way. Is the change you want always many minutes apart and why you want it as a tree? To find the one that happened many minutes before another? I know some people like how vscode has a timeline that says how many minutes/hours ago a change was, so they can pick it out

levodelellis··on How I use Kate editor
That's one reason why I implemented it so it wouldn't lose information.

Hmm. I plan to implement a diff. The way I have it, you could copy the current source, hit undo to a version you want to compare again than use the clipboard as the version to diff with (vscode calls this "Compare Active File with Clipboard".) If you mess up you can still hit undo to go through all the previous edits you made since it's not lossy. Would this be as good for your usecase?

levodelellis··on How I use Kate editor
I'm writing an editor. Could you explain to me the use case? I looked it up and I don't exactly understand the reason besides it might be fun to look at

I really did not like that other editors would lose text if you pressed undo and type. The way my undo's work is if you type "a b c" and hit undo twice (so it's just "a") then type "d", then undo twice, it'll restore to "a b c"

levodelellis··on Usability Improvements in GCC 15
Please gcc, let me have a `~/.config/gcc` config file or an ENV variable so I can ask for single lined error messages.

I literally do not need ascii art to point to my error, just tell me line:col and a unique looking error message so I can spend no more than 1 second understanding what went wrong

Also allow me to extend requires with my own error messages. I know it'll be non standard but it would be very nice tyvm

levodelellis··on An Interview with Zen Chief Architect Mike Clark
Great interview, more please. Is there a way to submit question? I'd like to know 1) what affects branch predictors? From my understanding return statements do and cmov does not 2) Why isn't there a conditional exception? to replace if (!cond) { __builtin_trap(); }
levodelellis··on 0+0 > 0: C++ thread-local storage performance
One way to avoid the extra code from constructors is to make them constexpr. This way the compiler can initialize it with 0 or a value and not generate all that extra code to execute a constructor at runtime.

I'm not sure how many people interested in this article is interested in C++ compile times but I once measured and wrote an article https://bolinlang.com/wheres-my-compile-time

levodelellis··on I Like and Use Global Variables
Has anyone told you to never use atomics? Have you not heard lockless programming is hard? (I saw this recently https://wiki.libsdl.org/SDL2/CategoryAtomic,) Have you written multi-threaded programs? I written two large ones. The fact you're suggesting non-experts use atomic is insanity. As well as criticizing 'overflow' in an article showing minimum easy to understand code to be read by people using completely different languages
levodelellis··on I Like and Use Global Variables
I'm the author

No, please don't

levodelellis··on I Like and Use Global Variables
If you want to write code to show me what you're talking about (best if I can run it) I'll tell you why or why not. I can tell you right now I dislike DI (and singletons) for reasons I can't cover in a single post
levodelellis··on I Like and Use Global Variables
I had a feeling someone would bring this up (I'm the author.) Your state really shouldn't be depending on IDs or handles from a counter function. I'm not sure if most people can agree with what is considered using a global variable which is why I wanted to define it near the start
levodelellis··on I Like and Use Global Variables
I'm the author. I seen people make mistakes writing pure functions with many if statements in them. For a small period I heard people say loops should be banned. Would you want to go that far?

If your narrow the usage of a global within a file you can get a lot of mileage. That's not how people tend to use globals and why I wanted to write about it

levodelellis··on I Like and Use Global Variables
I should have talked more about that in the article. I mentioned defer, making functions reentrant, etc, but languages with exceptions and without defer can make things much harder. I tried to make it clear the global state should be accessible from a handful of functions or within a file/module
levodelellis··on I Like and Use Global Variables
There's plenty of things in programming that are "hard to use correctly". I seen many codebases that you must clone an object because passing it in a function because there was so much spaghetti data structures that you'd end up accidentally mutating something you didn't mean
levodelellis··on I Like and Use Global Variables
I'm the author. You don't exactly need the program to be small, you could do a lot with a small file (under 500 lines) being the only one able to access a global variable. People seem to think it's ok to leak data from your encapsulation when you're using a global which I tried to say is a bad idea in the article.
levodelellis··on I Like and Use Global Variables
I'm the author of the article. How many comments are you going to write about how my usage is bad citing multi-threads when I said multi threading is out of scope? And how do you not understand this would be a how-to use thread locals correctly when you are dealing with multiple threads.
levodelellis··on Easy 6502
I read this a few years ago to refresh my 6502 knowledge, it's well done
levodelellis··on Global variables are not the problem
I like mutation in global variables. I don't think it's the problem. I'm explaining it in my next article
levodelellis··on Global variables are not the problem
You're right, I know mutable and read-only are separates, I know I seen gcc and clang put static int and global int in the same page, and I know I heard people say global variables are on the heap thousands of times. I guess I forgot global writable data doesn't necessarily mean heap nor the read-only section of memory
levodelellis··on Global variables are not the problem
I'm the author. No, I completely disagree. No one ever complains about logs and malloc except having too much of them - A line I removed from this article

The next article has examples and IMO much better, but makes no mention of action at a distance, and currently makes no mention of how people use clone to prevent mutability.

levodelellis··on Global variables are not the problem
Ouch, I partially address this in the next article
levodelellis··on Global variables are not the problem
Only if it's const. Otherwise the data is copied into memory you can write to
levodelellis··on Global variables are not the problem
I didn't mind. I knew I'd hear a lot of disagreements and incorrect thoughts. My next article has a lot of examples which should make things easier to digest.

One thing I dislike about compsci is everyone has different definitions for everything. If people say static variables are not on the heap fine, but you can easily see the address of a static variable and global variable being in the same 4K page

levodelellis··on Global variables are not the problem
What do you suppose is the recommended way to use the encapsulation? ;) This is partly why there's a "defining global variables" section, I know people will will consider some usage as not using a global
levodelellis··on Global variables are not the problem
You might like the article I wrote for next week. Could you tell me where this post is linked from? I didn't think anyone would see this when no one commented the first day
levodelellis··on Global variables are not the problem
You may hate my article next week, it's meant to replace this article. If you want you can email me for early access and tell me how I can improve the article. Lets say you can guess my email if you're emailing the right domain
← PreviousPage 2 of 5Next →