Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
levodelellis
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
31.
▲
by
levodelellis
1y ago
I've been meaning to ask you what the motivation of your project is? Why would you want a safe-c? When I saw the headline I was worried that all my runtime code would break (or get slower) because I do some very unsafe things (I have a
32.
▲
by
levodelellis
1y ago
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
33.
▲
by
levodelellis
1y ago
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)
34.
▲
by
levodelellis
1y ago
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
35.
▲
Nimble-C (C and C++ compiler) compiles millions of lines per second
(nimble-c.com)
2 points
by
levodelellis
1y ago
|
0 comments
36.
▲
by
levodelellis
1y ago
That took me a long time too. It was rewarding tho
37.
▲
by
levodelellis
1y ago
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
38.
▲
by
levodelellis
1y ago
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
39.
▲
by
levodelellis
1y ago
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
40.
▲
by
levodelellis
1y ago
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
41.
▲
by
levodelellis
1y ago
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 messag
42.
▲
by
levodelellis
2y ago
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 repla
43.
▲
by
levodelellis
2y ago
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 peop
44.
▲
by
levodelellis
2y ago
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 larg
45.
▲
by
levodelellis
2y ago
I'm the author No, please don't
46.
▲
by
levodelellis
2y ago
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
47.
▲
by
levodelellis
2y ago
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 va
48.
▲
by
levodelellis
2y ago
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 withi
49.
▲
by
levodelellis
2y ago
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 access
50.
▲
by
levodelellis
2y ago
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'
51.
▲
by
levodelellis
2y ago
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 e
52.
▲
by
levodelellis
2y ago
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
53.
▲
I Like and Use Global Variables
(codestyleandtaste.com)
36 points
by
levodelellis
2y ago
|
65 comments
54.
▲
by
levodelellis
2y ago
I read this a few years ago to refresh my 6502 knowledge, it's well done
55.
▲
by
levodelellis
2y ago
I like mutation in global variables. I don't think it's the problem. I'm explaining it in my next article
56.
▲
by
levodelellis
2y ago
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 g
57.
▲
by
levodelellis
2y ago
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 actio
58.
▲
by
levodelellis
2y ago
Ouch, I partially address this in the next article
59.
▲
by
levodelellis
2y ago
Only if it's const. Otherwise the data is copied into memory you can write to
60.
▲
by
levodelellis
2y ago
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
More ›