Ans also, that's the strength of C and its simple ABI.
324 karma · joined January 26, 2018
Ans also, that's the strength of C and its simple ABI.
As a matter or preference I really like colons and semi-colons.
That said your work is amazing. This is a true example of simplicity. I don't think most of people would get how difficult it is to keep it simple.
Everything is clear I can read the source code without asking myself "what is that", everything makes sense.
Thanks for presenting your work.
Do you have any constraints, like "no meta programming", "generated library should be as much as possible compatible with C", "it should have one pass optimization" or even "the compiler must be embeddable in most place as possible" ?
Oh, this is pretty sad...
Anyway thanks for your time. Was nice to interact with the author of D. I truly believe what you've done will inspire a lot of people.
I hope you didn't encounter too many people saying creating D was foolish.
I spent time checking about a lot of languages and only D (and Jai, but it's not released) would restore my joy of programming.
Don't get me wrong, I like to help people. But I learnt to not help people that do not seek help.
You get a plumber fixing your pipes because you need your pipes to be fixed, but if every single plumbers were offering there help it would be annoying.
There are already more that three hundreds proposals:
https://github.com/ziglang/zig/issues?q=is%3Aissue+is%3Aopen...
A lot of them are about the syntax. Maybe this won't be endless but I'm sure a lot of time are being wasted. The root of the issue I point seems to be bound to the way the devs are working. Not sure if it will be efficient to tell them to "think more carefully". I do believe my time can be more profitable elsewhere (like commenting here, ah ah).
D is actually a great language. I just "don't understand" why it's not massively used instead of more recent versions of C++, I consider newer version of C++ as a totally different language with more drawbacks than advantages. Half of new features are present to fix previous half baked features. This is quite embarrassing.
Sorry for my selection of words (and for the unrelated opinion, I had to rant), I'm not good at spending time to rephrase when the end content is the same.
I remember one time I spent the whole day browsing the website of D, everything actually make sense. There are still features that I wouldn't use, but this is what I expect from a programming language design. I was impressed by a lot of decisions.
I seemed to remember that I was a bit sad to not find proper performance benchmarks against other languages. I was intrigued because the documentation was so complete, it was just lacking this (maybe I just couldn't find them). It was a long time ago so it has probably been fixed. I will give it a try at some point.
I actually already knew everything. I watched closely the development of Zig, and just give up when I realized all those decisions where made carelessly in my view or I just simply disagree with the direction of the syntax.
Since you took your time I will take mine to address what I don't like:
- There is no way to write "int" by default. I understand why. But I don't agree.
- struct and enum statements (within braces) are separated by a comma which is inconsistent with statements in function separated with ",". In my view expect a difference between parameters and statements. parameters (a,b,c) statement {a;b;c}
- You have to type "var" or "const" everywhere, but not in struct statement and enum statement. Sometimes it's like a "def" sometimes not.
- You have to type const when importing module:
const std = @import("std"); // Why ? Why should I specify const, this should be inferred. Same when I define a struct.
- the "undefined" keyword when it means "uninitialized" even in the documentation. var my_var: i32 = undefined;
- The worst, no default values for struct.- The list of keywords is insane: errdefer, allowzero, orelse, unreachable, anyerror
- About iterator I was doing well with:
while(get_next(context, &item)) { /* ... */ }
It's like everything has been carefully design to be even less readable than C code. I have the feeling that the syntax help more the compiler than de developer.I wish I could bet thousands of dollars that there will be only one compiler in the whole life of Zig language (also because it relies way too much to LLVM).
It's just the CS community, at some point when you are writing languages you tend to try to outsmart the language you are fixing by creating overly complex behavior. Over-engineering is every single new languages.
Even Zig fails to do better than C, I think it's syntactically a disaster.
Here is a few lines from the documentation:
const ptr = @intToPtr(?*i32, 0x0);
while (it.next()) |item| { /* ... */ }
pub fn main() anyerror!void { /* ... */ }
exe.addCSourceFile("test.c", [_][]const u8{"-std=c99"});
const file = std.fs.cwd().openFile("does_not_exist/foo.txt", .{}) catch |err| label: { /* ... */ }examples in top of my head:
- adding object oriented feature like built-in constructor/destructor while only default values are needed as week as a defer statement.
- weird template, while I can sense that we only want a proper hygienic macro system.
And "array type", pointer with length, to deal with contiguous memory.
The rest is well described in the video, but those 3 points are my major issues.
- enumerate everything C is doing bad.
- presents fixes with a full bag of unnecessary features that no c programmer wants.
I wonder why there is no "Fixed C".
I think you underestimate the convenience of a text format.
It does not only provide a simple way to generate it, but also provide a way to modify it by hand.
Exactly like what is returned by strlen... ?
I'm following you on Github then.
Do you know how easy/difficult would it be to make a desktop version of it ?
One of my long term goal is to make it cross platform.
https://en.wiktionary.org/wiki/iatrogenic
An alarming fact was less dying patients when an hospital workers were in a strike action (during 2 weeks).
Your snippet won't work with this inline example:
before_after("hello", "world") { before_after("hello", "world") { }}