Better HN
topnewbestaskshowjobs
Log inSign up

the-lazy-guy

256 karma · joined Jun 21, 2016 (10y ago) · 56 submissions

Submissions

comment 3mo ago · link · parent

This is absolutely a JIT-compiler. It compiles code into machine code. This is a surprisingly efficient way to get noticeable speedup relative to interpretation. Also it is much safer than proper optimising compiler. Say ebpf jit-compiler functions very similarly, because it is fast and _secure_ way to jit. (well, there's a bit of cheating because before emitting bpf bytecode it goes through gcc/clang pipeline).

LLVM is a large dependency if you need to JIT. There are plenty of smaller (and much faster) alternatives which are much better fit for smaller projects. Larger projects usually roll out their own jit-pipeline because they can integrate better with the source language/interpreter and apply tricks LLVM is not well suited to (say, LLVM is not great at deoptimisation). I think only Julia is really a heavy user of LLVM JIT, also it is known for extremely slow repl from time to time.

comment 6mo ago · link · parent

Stored and transmitted data also has to be decoded. With modern datacenter hardware bottleneck is often CPU rather than network or disk (SSD). It depends on specific properties of the data. (I used to work on search index implementation which is about decoding and intersecting large amounts of hit-lists; and right SIMD-friendly varint encoding is obviously crucial)

comment 6mo ago · link · parent

You should use emacsclient, so file will be actually shared. Or better yet - use GUI emacs with its ability to have multiple frames.

comment 7mo ago · link · parent

While obviously super-impressive, it is clearly not maintanable without AI agent. It has spinel_codegen.rb is 21k lines of code with up to 15 levels of nesting in some methods.

Compilers code was never pretty, but even by those standard, I feel like it is a very-very hard to maintain code by humans.

comment 10mo ago · link · parent

Ok, let me call you out more explicitly. It is clear that most of the code is not written by you. Commit history shows that first a large feature appears out of the blue, then you have a followup series of commits removing "useless" comments (left by LLM). Quite a few useless comments are still there.

Also your rust implementation is 100% broken which some of comments you deleted point out.

I also love this comment: https://github.com/whispem/minikv/blob/main/src/coordinator/... It is exactly what LLMs write when you ask them to implement something.

comment 10mo ago · link · parent

https://github.com/whispem/minikv/blob/main/src/coordinator/...

Nice, you are the first person I have seen who cares to type in unicode arrow instead of "->" in comments.

comment 11mo ago · link · parent

Fil-C aborts your program if it detects unsafe memory operations. You very much can write code that is not memory safe, it will just crash. Also it has significant runtime cost.

Rust tries to prevent you from writing memory-unsafe code. But it has official ways of overcoming these barriers ("unsafe" keyword, which tells compiler - "trust me bro, I know what I'm doing) and some soundness holes. But beause safety is proven statically by compiler, it is mostly zero-cost. ("Mostly" because some things compiler can't prove and people resort to "unsafe" + runtime checks)

Two orthogonal approaches to safety. You could have Fil-C style runtime checks in Rust, in principle.

comment 1y ago · link · parent

> Once you add static linking to the toolchain (in all of its forms) things get really fucking slow.

Could you expand on that, please? Every time you run dynmically linked program, it is linked at runtime. (unless it explicitly avoids linking unneccessary stuff by dlopening things lazily; which pretty much never happens). If it is fine to link on every program launch, linking at build time should not be a problem at all.

If you want to have link time optimization, that's another story. But you absolutely don't have to do that if you care about build speed.

comment 1y ago · link · parent

That is exactly what you want to evaluate the thechnology. Not make a buggy commit into softwared not used by nobody and reviewed by an intern. But actually review it by domain professionals, in real world very well-tested project. So they could make an informed decision on where it lacks in capabilities and what needs to be fixed before they try it again.

I doubt that anyone expected to merge any of these PRs. Question is - can the machine solve minor (but non-trivial) issues listed on github in an efficient way with minimal guidance. Current answer is no.

Also, _if_ anything was to be merged, dotnet is dogfooded extensively at Microsoft, so bugs in it are much more likely to be noticed and fixed before you get a stable release on your plate.

comment 1y ago · link · parent

It is called experimentation. That is how people evaluate new technology. By trying to do small things with it first. And if it doesn't work well - retrying later, once bigger issues are fixed.

comment 1y ago · link · parent

Hot take: CPython is not an important project for Microsoft, and it is not lead by them. The faster CPython project had questionable acheivement on top of that.

Half of Microsoft (especially server-side) still runs on dotnet. And there are no real contributors outside of microsoft. So it is a vital project.

comment 1y ago · link · parent

This is Stephen Toub, who is the lead of many important .NET projects. I don't think he is worried about losing job anytime soon.

I think, we should not read too much into it. He is honestly exploring how much this tool can help him to resolve trivial issues. Maybe he was asked to do so by some of his bosses, but unlikely to fear the tool replacing him in the near future.

comment 1y ago · link · parent

> A 15,000-line proof is going to have a mistake somewhere.

If this proof is formal, than it is not going to. That is why writing formal proofs is such a PITA, you actually have to specify every little detail, or it doesn't work at all.

> Verifying that those 15,000 lines do what they do doesn't give me much more confidence than thorough unit testing would.

It actually does. Programs written in statically typed languages (with reasonably strong type systems) empirically have less errors than the ones written in dynamically typed languages. Formal verification as done by F* is like static typing on (a lot of) steroids. And HACL has unit tests among other things.

comment 1y ago · link · parent

Thank you. These 2 are well-known, as well as plenty others. But I wanted to see answer from the author of the comment to which I replied. Apart from tests (of which both sqlite and curl have plenty, and that is obviously good), I don't see any reasonable difference in sqlite or curl code in aspects which were mentioned in their comment (namely, style and ownership). I'd like to see what they think is reasonable C code.

comment 1y ago · link · parent

Can you please provide an example of good C code?

I agree that absence of tests isn't great, and is very common with many C-based projects. But the rest of your comments reads like "ooh, it's C, disgusting!". I hope, I'm wrong.

comment 1y ago · link · parent

Unrelated to suckless, there's a project (confusingly) named stal/IX: https://stal-ix.github.io/

It is also a statically linked Linux distribution. But it's core idea is reproducible nix-style builds (including installing as many different versions/build configurations of any package), but with less pl fuff (no fancy funcional language - just some ugly jinja2/shell style build descriptions; which in practice work amazingly well, because underlying package/dependency model is very solid - https://stal-ix.github.io/IX.html).

It is very opionated (just see this - https://stal-ix.github.io/STALIX.html), and a bit rough, but I was able to run it in VMs sucessfully. It would be amazing if it stabilizes one day.

comment 1y ago · link · parent

Did you notice that you just devided kids in Loudoun and Baltimore in 2 groups, giving them as examples of different environments? You do not object to premise, only to granularity of defining environment geographically.

comment 1y ago · link · parent

Sabotaging any infrastracture harms people. Transitioning to clean energy can be (and is being) sped up by actual peaceful actions.

The second talk is especially ridiculous when the speaker suggests to sabotage datacenters, because they use a lot of resources. I guess it is part of the "degrowth" ideology, which I find deeply flawed.

comment 2y ago · link · parent

No, it cant. These 2 are semantically not eqivalent, because in async version caller of f1() is resumed only once fetch has completed. In your callback version it will be resumed immediately.

Also think how this should be translated: function f1() { x = await fetch('something'); return x + 1; }

comment 2y ago · link · parent

It's not about syntax. There is a huge difference in implementation and semantics between stackful coroutines (which go uses) and stackless coroutines (which most languages with async/await use).

For all practical purposes goroutines behave as separate threads with blocking calls. The fact that they are multiplexed on a few system threads is an implementation detail.

Otherwise you could say that using system threads directly is also asynchrnous programming. After all, your thread gets suspended on system calls (including synchronization primitives) and is resumed upon their completion.

comment 2y ago · link · parent

> The community would like to get absolute power so it can just make decisions about military sponsorships beforehand.

There is no such thing as "community" when talking about power. Certain people will have power. Maybe wider community agrees with them. If there is an established way to transfer this power (and install a different governance structure), then they can use it. If there is no such way, they may ask edolstra to step down, but surely he is not obliged to do so.

Historically, forking was a way for open source communities to diverge when they had incompatible values. There are plenty of examples of successful forks, preferred by community.

A teeny little bit of me thinks, that people who are not happy with current leadership do not want to fork the project because they are not sure that wider community cares enough to follow them.

comment 2y ago · link · parent

This does not sound as bad as you want it to.

Last time I checked, Boeing was responsible roughly for the half of all flights worldwide and fligths are 3 orders of magnitude safer than car trips.

comment 2y ago · link · parent

Small correction. Judging by here LinkedIn page (I will not provide link, but it is public), she is not Israeli, she is an american Jew. I think, it is important to point it out since Israeli jews (including Google employees I know) have a very different sentiment about supporting their government.

comment 3y ago · link · parent

My point is that Twitter is not spiraling out of control into irrelevance, as demonstrated by you and me discussing a twit. And twitter is running relatively fine, as demonstrated by our ability to open pages on that website.

comment 3y ago · link · parent

You are replying in a thread about a twit though.

comment 3y ago · link · parent

I had a brief look at Gates Foundation spending and it does not look like tax dodge to me: https://www.gatesfoundation.org/about/financials/annual-repo...

It spent about 10% of its endowment for charity last year.

comment 3y ago · link · parent

> In my experience when a smaller company starts to writes tools that solve the imaginary problems of the CTO they are not focusing on solving customer problems and this usually ends badly.

Like writing their own web framework in obscure programming language?

comment 3y ago · link · parent

This is awesome! I use it since initial "gccemacs" announcements.

It is still order of magnitude slower than JS. Dynamic binding, ability to redefine or advice any function and fundamentally cache-unfriendly core datastructures (cons-cells) and absence of JIT hotspot optimization do not help to catch up with competition :(

comment 3y ago · link · parent

I disagree. When I am running a compilation (with output being dumped into a visible buffer) + query magit for large commit. Over tramp. Things noticeably freeze. Technically it all is async. Practically, it is implemented as polling things on main thread with some witing happening in non-async fashion.

> For example, querying your compiler for a list of methods that apply to the current object, or a list of functions that start with “Foo” are mostly moving to external processes using LSP as the communication protocol.

That's why we have lsp-bridge and lsp-mode emacs fork :) Both of which build some infrastructure to avoid doing communication work with lsp-mode work in main emacs thread. So, heavy emacs users are building some async machinery which wraps another already async and relatively lightweight protocol, because core emacs facilities can't keep up with it. Architecturally it is kind of insane.

I think, lsp-mode fork is doing the right thing (from practical POV; it goes against "emacs is just an elisp interpreter" ideology though) and hope it gets into core at some point. A better solution would have being having first class async and background threads support at the elisp level. Which would never happen due to elisp messiness.

https://github.com/emacs-lsp/emacs https://github.com/manateelazycat/lsp-bridge

comment 3y ago · link · parent

As an emacs user I have to say that IntelliJ (and pretty much any modern IDE) feels snappier than emacs configured to do anything comparable (lsp-mode/eglot, corfu/company, tree-sitter etc).

While IDEs may require more resources, they usually utilize them better.

Emacs is fundamentally single-threaded and not great at async things. With most of the logic written in a very slow non-JIT friendly language with naive blocking GC. Rendering pipeline is also a mess. Underlying internal datastructures are also very naive (which is a good thing when you implement things in C).

Things are slowly changing. emacs now is a lot better than 5 years. So may be in 10 years it will really rival more modern competitors in terms of performance.

Having said all this, emacs universality and extensibility keep me with it.

12