Live data from Hacker News

Tilde, My LLVM Alternative

yasserarg.com

91–100 of 165 posts

Re: Tilde, My LLVM Alternative

#92
post #79
post #61

Earlier quoted context omitted.

What aspects do you consider "ultra-complex"? I agree that it has a very strange syntax, many features of it being unknown to most people; but besides that, it's as easy as Pascal, isn't it?

Pascal doesn't have half as UB as C, or possibilities to memory corruption. Pascal here meaning compilers people actually use, not ISO Pascal from 1976, people love their C extensions after all. A for C's simplicity, one just needs to organise a pub quiz, using ISO, and key extensions as source of inspiration.

UB has nothing to do with complexity. In any case, from about 87 UB in the core language, we eliminated 15 in the last meeting, and already have concrete proposals for 10 more. C2Y will likely not have any trivial UB and hopefully also optional safety modes that eliminate the others.

Re: Tilde, My LLVM Alternative

#93
post #89
post #79

Earlier quoted context omitted.

Pascal doesn't have half as UB as C, or possibilities to memory corruption. Pascal here meaning compilers people actually use, not ISO Pascal from 1976, people love their C extensions after all. A for C's simplicity, one just needs to organise a pub quiz, using ISO, and key extensions as source of inspiration.

When refering to Pascal, I mean something like Turbo, Vax or Apple Pascal, i.e. the version used at the height of popularity. Original Pascal has much less degrees of freedom. And I have no reason to assume that Turbo or Apple Pascal have less possibilities for memory corruption, or are better specified.

Starts by having proper strings and array types with bounds checking instead of pointers, followed by memory allocation with types instead of sizeof math, less scenarios for implicit conversions, reference parameters reducing the use cases where an invalid pointer might be used instead.

Re: Tilde, My LLVM Alternative

#94
post #88
post #18

Earlier quoted context omitted.

Cwerg looks interesting indeed. I had it on my radar for some time. Especially its focus on simplicity and independence (e.g. that it can directly generate ELF executables) are attractive. From my humble point of view, both Python 3 and C++17 are a bit unfortunate as implementation languages. I can understand that the author didn't want to use C, but C++98 would have resolved this issue with less build and dependency…

Given how long it takes for compilers to mature, by the time it's ready I didn't think anyone will care about x86. Similarly for c++11 vs 17. No?

Well, for all applications which don't require to addres more than 4 GB memory, a 64 bit machine is overkill. This especially applies to embedded systems (which make up the majority of all systems). This is unlikely to change for the next fifty years.

Re: Tilde, My LLVM Alternative

#95
post #92
post #79

Earlier quoted context omitted.

Pascal doesn't have half as UB as C, or possibilities to memory corruption. Pascal here meaning compilers people actually use, not ISO Pascal from 1976, people love their C extensions after all. A for C's simplicity, one just needs to organise a pub quiz, using ISO, and key extensions as source of inspiration.

UB has nothing to do with complexity. In any case, from about 87 UB in the core language, we eliminated 15 in the last meeting, and already have concrete proposals for 10 more. C2Y will likely not have any trivial UB and hopefully also optional safety modes that eliminate the others.

It certainly has, as proven by recent talk at BlueHat 2024, on Windows kernel refactorings, as not everyone is knowledgeable of ISO C minutia and how optimisers take advantage of it, and still think they know better than analysers.

Re: Tilde, My LLVM Alternative

#96

I'm confused, is this some kind of re-post? I saw this exact same post with the exact same comments on it awhile ago. Could have been more than a couple of weeks. Very strange.

It was posted three days ago, and got re-upped by the mods via the the second chance pool[0].

[0] https://news.ycombinator.com/pool

Re: Tilde, My LLVM Alternative

#97
post #76

Earlier quoted context omitted.

> I am curious about the issues with C++17 (vs say C++11) though. It's about dependability and bootstrapping. GCC 4.7 was the last version implemented in C, and it supports C++98/03 and a subset of C++11. > There are some warts here and there that C++17 fixes [..] nothing major But it's C++17 and thus requires many more bootstrap cycles until we have a compiler. I think a backend which only supports a subset of the f…

I can commiserate. I did some bootstrapping of gcc 10 years ago and it was the most miserable experience ever. You make a change somewhere. Kick off "make" and 20 min later you get some bizarre error in some artifact that is hard to find, generated by a build system that is impossible to trace. A self-hosting Cwerg will hopefully be much easier to bootstrap because of its size. But until then, why do you need the (co…

I didn't express a requirement for Cwerg, but just tried to explain why I prefer to implement a compiler in C++98 than C++17.

Re: Tilde, My LLVM Alternative

#98

Earlier quoted context omitted.

Rust? Zig?

[flagged]

Ah yes, the 10th most popular general purpose programming language in the world is a meme language. Facepalm.

I know you'll ask for a source on that so:

https://www.jetbrains.com/lp/devecosystem-2024/

Excluding HTML, CSS, Shell and SQL because they aren't general purpose programming languages. Excluding Typescript because it's really just type annotations for JavaScript.

Re: Tilde, My LLVM Alternative

#100
post #90
post #58

Earlier quoted context omitted.

C itself is an ultra-complex language. I do not understand the mindset of the "C is simple" crowd. Is it nostalgia or romanticism for the past? If we want to devise a truly simple language, we need to start by realizing that C is just the Javascript of its day: hacked together in a weekend by someone who wished they were using a different language and then accidentally catapulted into the future by platform effects.

While it has its fair share of quirks it is certainly not an "ultra-complex" language.

The sleight of hand here is that by leaving so many things undefined, unspecified, and implementation-defined, C gets to foist complexity off on the implementations and then act as though it's absolved of blame when things go off the rails. The fact that what felt like half of all traffic on Usenet and IRC in the 90s was comprised of people language-lawyering over what is and is not valid C disqualifies it from being considered a simple language. It's as though someone designed a language where the spec is the single sentence "the program does what the user intends it to do" and then held this up pinnacle of simplicity. C has an entire Wikipedia article about how needlessly difficult it is to parse: https://en.m.wikipedia.org/wiki/Lexer_hack . C has an entire website for helping people interpret its type gibberish: https://cdecl.org/ . C's string handling is famously broken. C's formatting machinery is Turing complete! Coercions out the wazoo. Switch fallthrough having exactly the wrong default. The fact that Duff's Device works at all. Delegating all abstraction to an infamously error-prone textual macro language. You could spend an entire career learning this language and still find exciting new ways to blow your leg off. If C is our bar for simplicity, it explains a lot about the state of our profession.
Post reply on HN