> Deprecate Lua, Python, JavaScript, Ruby and a dozen other languages, because Pretty C is the ultimate scripting language, but lightning-fast and strongly typed! Umm… that’s quite the goal. I’ll stick with deprecated Python.
Deprecate Python?! You'll have to deprecate me first! ;-)
Pretty.c
111–120 of 227 posts
Re: Pretty.c
#112as someone that just started C, it looks pretty :)
Re: Pretty.c
#113Earlier quoted context omitted.
I mean he has to be serious, right: "Deprecate Lua, Python, JavaScript, Ruby and a dozen other languages, because Pretty C is the ultimate scripting language, but lightning-fast and strongly typed!!"
Author here. I don't see any problem with this
Re: Pretty.c
#114Earlier quoted context omitted.
Author here. I don't see any problem with this
Well, as a starter C is rarely considered as "strongly typed". Statically typed yes, but strongly typed not so much.
Re: Pretty.c
#115Type names are nice; Perfect choice for the in-built func macros (like min); Len -- love it. Named boolean operators -- might be a bit much but go for it; Ternaries are illegible so you can only improve them; Not completely sold on all your loop definitions but some make sense to me; Resource tracking is impressive; The for... look a bit ugly -- could probably call it something else. All in all: quite a solid attempt…
Well, you don't have to use it all. My projects mostly use booleans, len(), max/min, and some operator aliases, because there wasn't much need for other tasty stuff yet. So give it a shot, even if for a couple of operator macros!
Re: Pretty.c
#116Can someone clarify whether this is intended as a joke or whether the author is actually confused? I mean, nothing about this makes sense: it's not "scripting"; it claims to introduce "strong typing" while it does nothing about typing; it introduces all kinds of operator aliases "modeled after Lua and Lisp" that are present in neither of these languages. But it's not an obvious parody either, so I'm genuinely not sur…
I mean he has to be serious, right: "Deprecate Lua, Python, JavaScript, Ruby and a dozen other languages, because Pretty C is the ultimate scripting language, but lightning-fast and strongly typed!!"
Re: Pretty.c
#117> turn any codebase into a beginner friendly one Okay then. I was hoping to see a “this is just for fun” disclaimer but didn’t see one. Please never actually use this in a project that other people will have to read or contribute to.
Re: Pretty.c
#118Earlier quoted context omitted.
setxkbmap us -option ctrl:swapcaps -option compose:rwin Problem solved. US layout, and with the right Window keys you can compose European characters.
There’s so many assumptions here about a person who’s starting to learn programming. For starters, that they’re on Linux, they feel comfortable running complex CLI commands, they can memorize the U.S. layout just like that, and that they can type without looking at the physical keys (because changing the virtual mapping means keys produce something else than what the label says). In reality, the learner’s first expos…
It's looks like being deliberately designed for press/office usage and not for proper programming.
Re: Pretty.c
#119Earlier quoted context omitted.
Well, as a starter C is rarely considered as "strongly typed". Statically typed yes, but strongly typed not so much.
With C23 (nullptr, auto typing, typeof) and C11 (generics) it got more guarantees and type-related primitives. You can still do void*, but you are strongly discouraged from it.
#include "pretty.h"
void print_int(int value){
println(value);
}
int main (int argc, string argv[])
{
long value = 23849234723748234;
print_int(value);
}
How is this strongly typed? $ cc test.c -o test && ./test
-1411401334
And to be clear, weak vs strong isn't a boolean property but a spectrum, but would be hard to argue with a straight face than C is a strongly typed language.Re: Pretty.c
#120The code asumes that C17 has C++-style auto ( https://github.com/aartaka/pretty.c/blob/master/pretty.h#L11... ), it does not (in C auto is storage specifier that is equivalent to no storage specifier).
C17 doesn't have auto, but C23 does, and thus my `__STDC_VERSION__ > 201710L` (notice the greater than sign, it doesn't include C17 itself.)