4 ms·
Is there a language that's substantially free of gibberish?
by card_zero 2y ago
Is there a language that's substantially free of gibberish?
- marginalia_nu 2y agoYeah sure, COBOL is great in that regard. Basically reads as English.
- pwilson7 2y agonope
- pjmlp 2y agoThose of Algol/Wirth linage, or influenced by then. Then again people complain that they are too verbose, and they rather write in hieroglyph friendly languages.
- Joker_vD 2y agoCompare char (*(*x())[5])(); and var x: pointer to func() pointer to array[5] of pointer to func() char; or if you wish to replace some keywords with glyphs: var x: ^func() ^[5] ^func() char; And it's always a nice puzzle for the reader to explain why there are three "pointer" in cdecl output and three carets in the ALGOL-like declaration, but only two asterisks in the C declaration.
- trealira 2y agoIn this case, the C declaration doesn't match the other two. The variable x is a function that returns a pointer to an array of 5 pointers to functions returning char. Indeed, that's what cdecl.org says: declare x as function returning pointer to array 5 of pointer to function returning char Using the notation you did, that would be: var x: func() ^[5] ^func() char There are only two arrows there now. If you wanted a pointer to a function like this, you would need a third asterisk in the declaration: char (*(*(*x)())[5])();
- Joker_vD 2y agoOh, good catch, thank you! But I remember an example with some other tricky C expression/type declarator where the number of actual dereferences differed from the amount of asterisks in the code. > Using the notation you did, that would be: Well, it'd be func x() ^[5] ^func() char; ... because it's a function declaration, after all, not a variable.
- trealira 2y ago> But I remember an example with some other tricky C expression/type declarator where the number of actual dereferences differed from the amount of asterisks in the code. Was it this code? void f(int *a) { void *p = &a; ***(int*(*)[])p = 1; } Reading your comment made me think of this. I tried to find the original post for this, but it seems it was deleted. I only found it again through this post: https://zig.news/sobeston/using-zig-and-translate-c-to-understand-weird-c-code-4f8 https://zig.news/sobeston/using-zig-and-translate-c-to-under...
- dogleash 2y agoDepends on the features you want.
- chongli 2y agoRacket Beginning Student [1] language. [1] https://docs.racket-lang.org/htdp-langs/beginner.html https://docs.racket-lang.org/htdp-langs/beginner.html
- gorjusborg 2y agoAnd its predecessor, Scheme, which is my vote.
- unrealhoang 2y agofor declaring function pointer? Any language with type after name : // c char (*(*x[3])())[5]; // golang var x [3]func() *[5]byte
- sitzkrieg 2y agoforth will contain as much gibberish as you put into it