Live data from Hacker News

Pretty.c

github.com

61–70 of 227 posts

Re: Pretty.c

#61

Earlier quoted context omitted.

> I've seen "loop" in other languages. But Qt calls it "forever", and that is indeed very pretty. Very Qt, even You can break a "forever" loop so I think "loop" is a better name.

I don’t know why “repeat” isn’t very common in place of while/loop/etc; it works out nicely grammatically. repeat {} repeat while {} repeat {} while repeat {}

One possible reason:

> The word "REPEAT" should not be used in place of "SAY AGAIN", especially in the vicinity of naval or other firing ranges, as "REPEAT" is an artillery proword defined in ACP 125 U.S. Supp-2(A) with the wholly different meaning of "request for the same volume of fire to be fired again with or without corrections or changes" (e.g., at the same coordinates as the previous round).

https://en.wikipedia.org/wiki/Procedure_word#Say_again

More seriously, PASCAL has repeat-until loops, similar to do-while loops in C.

Re: Pretty.c

#62
post #57

Can 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 do not at all think the author is confused. Being confused is OK though.

Re: Pretty.c

#63
post #23
post #7

Earlier quoted context omitted.

> Provide so much syntactic sugar as to cause any C developer a diabetes-induced heart attack. seems like its obvious to me that its a joke

It's a joke that I would happily use.

C is funny, in many ways.

Re: Pretty.c

#64

It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT ( https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... ) and you can have instantaneous execution and even a REPL!

I'd prefer just using tcc [0]. Far lighter weight than that monster. And C, not C++.

[0] https://bellard.org/tcc/tcc-doc.html

Re: Pretty.c

#65
post #54

Earlier quoted context omitted.

There were article suggesting #define BEGIN { and #define end }; to make C look more like Pascal. I think in Europe C was not as common as other languages at the time so the terseness looked odd.

Also because the special characters were (and are) difficult to type on European keyboards. Characters like []{}\|~ are behind multi-finger access and often not printed at all on the physical keys (at least in the past). You can see how this adds a hurdle to writing C… Pascal was designed by a European, so he preferred keywords which could be typed on every international keyboard. C basically just used every symbol f…

Just as example, on my slovenian QWERTZ layout: [ - altgr+f, ] - altgr+g, { - altgr+b, } - altgr+n, \ - altgr+q, | - altgr+w, ~ - altgr+1.

You get used to them, though you start feeling like a pianist after a short coding session. The one most annoying for me are the fancy javascript/typescript quotes, which I have to use all too often: ` - altgr+7.

Re: Pretty.c

#66

> 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! ;-)

Re: Pretty.c

#68
I feel compelled to try it out in a serious way and contribute to it. I have strong knowledge of python and am learning C. Are there good reasons -apart from attracting the ire of c-programmers- to not use it?

Re: Pretty.c

#69

It claims to be a scripting language but you still have to compile the programs. Boo! Add CINT ( https://root.cern.ch/root/html534/guides/users-guide/CINT.ht... ) and you can have instantaneous execution and even a REPL!

Given the idea behind this repo is to cause pain, why not add a shebang to your file [0] to make it executable.

I saw a blog post a long time ago that went into the details of how ./foo worked, and how it executed an elf file. You could register `.c` programs in the same way to be compiled and run?

[0] https://gist.github.com/jdarpinian/1952a58b823222627cc1a8b83...

Re: Pretty.c

#70

Reminds me of a C++ codebase I once had to inspect that was entirely written as if it were written in Java. With camelcase naming for everything, getters and setters for every class variable, interfaces everywhere.

I've seen similar codebases as well written by people who have spent way too much time with Java. One even had it's own String class which was just a wrapper for std::string with Java-like methods.
Post reply on HN