Basically C2/C3 but Rust influenced. Missed chance to call it C4.
Zen-C: Write like a high-level language, run like C
141–150 of 159 posts
Re: Zen-C: Write like a high-level language, run like C
#142Earlier quoted context omitted.
Given an option that is configurable, why would the default setting be the one that increases probability of errors? For some niches the answer is "because the convenience is worth it" (e.g. game jams). But I personally think the error prone option should be opt in for such cases. Or to be blunt: correctness should not be opt-in. It should be opt-out. I have considered such a flag for my future language, which I name…
> Given an option that is configurable, why would the default setting be the one that increases probability of errors? They're objecting to the "given", though. They didn't comment either way on what the default should be. Why should it be configurable? Who benefits from that? If it's to make it so people don't have to type "var mut" then replace that with something shorter! (Also neither one is more 'correct')
I think "const x = something();" would be logical but they've used const already for compile-time constants. There's probably a sensible way of overloading that use though, depending if the expression would be constant at compile-time or not, but I've not considered it enough to think about edge cases (as it basically reduces to the halting problem unless any functions called are also explicitly marked up as compile time or not).
Re: Zen-C: Write like a high-level language, run like C
#143Earlier quoted context omitted.
> Given an option that is configurable, why would the default setting be the one that increases probability of errors? They're objecting to the "given", though. They didn't comment either way on what the default should be. Why should it be configurable? Who benefits from that? If it's to make it so people don't have to type "var mut" then replace that with something shorter! (Also neither one is more 'correct')
Well, arguably if it's immutable, then it's not a variable so "var" doesn't make sense. The corollary is if it's a variable it should be mutable so "var mut" is a tautology. I think "const x = something();" would be logical but they've used const already for compile-time constants. There's probably a sensible way of overloading that use though, depending if the expression would be constant at compile-time or not, but…
And "variables" in math are almost always immutable within a single invocation. It's not a particularly bad word to use. But there's plenty of options. const/var. let/var. let/mut. var/mut I guess. let/set from a sibling comment.
Re: Zen-C: Write like a high-level language, run like C
#144Re: Zen-C: Write like a high-level language, run like C
#145i really like this project. fot me its the next level to your own custom C lib. first your write 'tutorial C'. then after enough segfaults and double frees you start every project with a custom allocator because you've become obsessed with not having that again..., then you implement a library with a custom more generic one as you learn how to implement them, and add primitives you commonly build that lean on that al…
Re: Zen-C: Write like a high-level language, run like C
#146Earlier quoted context omitted.
Words only have the meaning we give them, and "variable" already has this meaning from mathematics in the sense of x+1=2, x is a variable. Euler used this terminology, it's not new fangled corruption or anything. I'm not sure it makes too much sense to argue they new languages should use a different terminology than this based on a colloquial/nontechnical interpretation of the word.
I get your point on how the words meanings evolves. Also it’s fine that anyone name things as it comes to their mind — as long as the other side get what is meant at least, I guess. On the other it doesn’t hurt much anyone to call an oxymoron thus, or exchange in vacuous manner about terminology or its evolution. On the specific example you give, I’m not an expert, but it seems dubious to me. In x+1=2 , terms like x…
The use of "variable" to denote an "unknown" is a very old practice that predates computers and programming languages.
Re: Zen-C: Write like a high-level language, run like C
#147Earlier quoted context omitted.
I get your point on how the words meanings evolves. Also it’s fine that anyone name things as it comes to their mind — as long as the other side get what is meant at least, I guess. On the other it doesn’t hurt much anyone to call an oxymoron thus, or exchange in vacuous manner about terminology or its evolution. On the specific example you give, I’m not an expert, but it seems dubious to me. In x+1=2 , terms like x…
"Damit wird insbesondere zu der interessanten Aufgabe, eine quadratische Gleichung beliebig vieler Variabeln mit algebraischen Zahlencoeffizienten in solchen ganzen oder gebrochenen Zahlen zu lösen, die in dem durch die Coefficienten bestimmten algebraischen Rationalitätsbereiche gelegen sind." - Hilbert, 1900 The use of "variable" to denote an "unknown" is a very old practice that predates computers and programming…
Re: Zen-C: Write like a high-level language, run like C
#148Earlier quoted context omitted.
“Immutable” and “variable” generally refers to two different aspects of a variable’s lifetime, and they’re compatible with each other. In a function f(x), x is a variable because each time f is invoked, a different value can be provided for x. But that variable can be immutable within the body of the function. That’s what’s usually being referred to by “immutable variable”. This terminology is used across many differ…
Probably variable is initially coming out of an ellipsis for something like " (possibly) variable* value stored in some dedicated memory location ". Probably holder , keeper* or warden would make a more accurate terms using ordinary parlance. Or to be very on point and dropping the ordinariness, there is mneme[1] or mnemon[2]. Good luck propagating ideas, as sound as it might, to a general audience once something is…
No, the term came directly from mathematics, where it had been firmly established by 1700 by people like Fermat, Newton, and Leibniz.
The confusion was introduced when programming languages decided to allow a variable's value to vary not just when a function was called, but during the evaluation of a function. This then creates the need to distinguish between a variable whose value doesn't change during any single evaluation of a function, and one that does change.
As I mentioned, the terms apply to two different aspects of the variable lifecycle, and that's implicitly understood. Saying it's an "oxymoron" is a version of the etymological fallacy that's ignoring the defined meanings of terms.
Re: Zen-C: Write like a high-level language, run like C
#149Re: Zen-C: Write like a high-level language, run like C
#150Earlier quoted context omitted.
Nim is a high-level language as well and compiles to C.
Odin and Jai are others.
V's approach is to have various backends, in addition to native (to be focused on from 0.6); C, JavaScript, WASM, etc...