Live data from Hacker News

Let's Destroy C

gist.github.com

11–20 of 192 posts

Re: Let's Destroy C

#11

> Windows has a different line ending But not when printing to stdio.h text streams; \n turns into the right line ending.

> But not when printing to stdio.h text streams; \n turns into the right line ending.

Only on some, but not all, compilers. I got varying behaviour until I went ahead and did it myself.

Re: Let's Destroy C

#12
post #2

the best thing about this was discovering https://git.sr.ht/

I love the simple and lightweight interface, but everything is hard to discover.

Sourcehut? Sounds great- I'd love to replace my Gogs/gitlab instance with something more lightweight. Let's download the source and run it. I guess click on "git" on https://git.sr.ht/? Wait that's where I already am with no indication that that is the selected tab. Ok maybe the link for sourcehut? https://sourcehut.org/ Cool. There's some links about pricing, ignore that and click on "100% free and open source software" Now I am just at a list of what appears to be about 20 repos, all with helpful names like sr.ht-apkbuilds.

I can tell that this person has put a ton of work into making something that is probably fantastic, but it is really all presented in an undiscoverable way. I still have no idea what language this project is written in, how to deploy or maintain it.

I assume https://git.sr.ht/~sircmpwn/git.sr.ht might be what I want, but it still looks like the inscrutable mess that reminds me of hgweb. There's not even a readme on the first page, let alone the source or anything useful. There's a link to https://man.sr.ht/git.sr.ht/installation.md. Which looks like it might be what I want, but I guess I'm old and at this point I've lost interest.

I'm definitely being crotchety, but I wish this information was organized in a more useful way. I can tell Drew has put a lot of time into it, but I don't feel like it is being shared in an effective way. And I would definitely never pay for software like this. Please someone tell me I'm crazy and this UI makes perfect sense to them.

Re: Let's Destroy C

#13
post #8

Ah, finally a modern successor to Bournegol: http://oldhome.schmorp.de/marc/bournegol.html

#define TYPE typedef #define STRUCT TYPE struct #define UNION TYPE union Well, that's extremely opinionated. Which I guess is the point. It does seem to add a BASIC-ness to the code. However, when I see landmines like these: #define TRUE (-1) #define FALSE 0 I might just hide instead of touching it.

Uh... This is serious landmine... I suggest author to change this.

Re: Let's Destroy C

#14
post #13
post #8

Earlier quoted context omitted.

#define TYPE typedef #define STRUCT TYPE struct #define UNION TYPE union Well, that's extremely opinionated. Which I guess is the point. It does seem to add a BASIC-ness to the code. However, when I see landmines like these: #define TRUE (-1) #define FALSE 0 I might just hide instead of touching it.

Uh... This is serious landmine... I suggest author to change this.

This particular code isn't about the post. It's about Bournegol, which doesn't actually exist anymore, and is actually quite hard to track down any examples of.

Re: Let's Destroy C

#15
post #13
post #8

Earlier quoted context omitted.

#define TYPE typedef #define STRUCT TYPE struct #define UNION TYPE union Well, that's extremely opinionated. Which I guess is the point. It does seem to add a BASIC-ness to the code. However, when I see landmines like these: #define TRUE (-1) #define FALSE 0 I might just hide instead of touching it.

Uh... This is serious landmine... I suggest author to change this.

Can you explain why?

Re: Let's Destroy C

#17
post #13

Earlier quoted context omitted.

Uh... This is serious landmine... I suggest author to change this.

Can you explain why?

On C language an expression which evaluates to any non-zero value is considered as True. So for example this kind of statement would not likely behave as intended:

    if (TRUE == expression)
    {
        ...
    }

Re: Let's Destroy C

#18
post #13

Earlier quoted context omitted.

Uh... This is serious landmine... I suggest author to change this.

Can you explain why?

To emphasise: This is about Bournegol. Nothing to do with this post.

> Can you explain why?

Because it isn't how most C libraries expect true/false to be defined.

stdbool in C99 standardized things a bit, but before then what was generally accepted was:

> true is 1

> false is !true (Often 0 in practice).

Which means that any trivial:

    if(true) { ... }
Won't work under Bournegol. Instead you _need_ to compare when doing an if statement.

So the C-programmer is easily tripped up. False will work as expected, but True won't... All the time. There may be times it does work. Leaving the programmer throwing their hands in the air.

Re: Let's Destroy C

#20
post #18

Earlier quoted context omitted.

Can you explain why?

To emphasise: This is about Bournegol. Nothing to do with this post. > Can you explain why? Because it isn't how most C libraries expect true/false to be defined. stdbool in C99 standardized things a bit, but before then what was generally accepted was: > true is 1 > false is !true (Often 0 in practice). Which means that any trivial: if(true) { ... } Won't work under Bournegol. Instead you _need_ to compare when doin…

Ah. Thanks for the explanation.
Post reply on HN