Live data from Hacker News

Two types of C programmers

utcc.utoronto.ca

41–50 of 225 posts

Re: Two types of C programmers

#41
post #33
post #16

Some people like to workship whatever the UNIX founders have done, yet they miss that for Plan 9 and Inferno, they also decided to go with automatic memory management languages. While Alef failed, Limbo's design with GC was considered a revisit from what was missing from Alef. They also miss that lint was considered a must have tool for safer C code, introduced in 1979, and that Dennis actually proposed fat pointers…

> yet they miss that for Plan 9 and Inferno, they also decided to go with automatic memory management languages And which of these three operating systems won?

Operating systems don't "win" because they make the best technical choices ... or even because they are best for their users.

Re: Two types of C programmers

#42
post #33
post #16

Some people like to workship whatever the UNIX founders have done, yet they miss that for Plan 9 and Inferno, they also decided to go with automatic memory management languages. While Alef failed, Limbo's design with GC was considered a revisit from what was missing from Alef. They also miss that lint was considered a must have tool for safer C code, introduced in 1979, and that Dennis actually proposed fat pointers…

> yet they miss that for Plan 9 and Inferno, they also decided to go with automatic memory management languages And which of these three operating systems won?

The free beer one, because everyone likes to get source tapes for free, regardless of the quality, free usually wins out.

Re: Two types of C programmers

#43
post #5

I'd consider myself the former: I use C because it's the only viable option for what I'm doing - but most of the time it's nothing to do with C itself, but the various extensions and builtins of GCC. It's the inline asm, the control of registers, placement of code and data, control of inlining, etc, which are missing from all of the C "replacements". The replacements assume you are building a user application on top…

D has a very nice inline assembler, bitfields, inline control, alignment control, etc.

C's "register" keyword has been ignored since 1990 or so.

Re: Two types of C programmers

#44

Why I love C? In a word, simplicity. A language designed by a single person. I also did program a lot in CLisp, a language designed by committee, with more than 100 different flow control directives(and people often create their own). I loved and love Lisp as a concept and tool, but hated CLisp complex design so badly. I programmed in Arc for a while because of that. I have created my own C compiler and interpreter.…

>I have created my own C compiler and interpreter.

It's relatively simple because everything is UB/UsB/IDB. ;)

Re: Two types of C programmers

#45
post #9

I also mostly use other languages these days, but there's still something about C that always feels like coming home to me. Maybe it's because it's what I used during my apprenticeship which is where the magic of programming finally clicked for me (after a failed attempt taking a programming class). Maybe it's just the simplicity and lack of rules to learn.

the simplicity of c is an illusion the moment you start using pointers and define macros. nothing is harder to understand than a big C program, imo

I don't see how simplicity is lost through use of pointers. Dynamic language variable references are essentially pointers and they couldn't be simpler.

Re: Two types of C programmers

#46

Why I love C? In a word, simplicity. A language designed by a single person. I also did program a lot in CLisp, a language designed by committee, with more than 100 different flow control directives(and people often create their own). I loved and love Lisp as a concept and tool, but hated CLisp complex design so badly. I programmed in Arc for a while because of that. I have created my own C compiler and interpreter.…

> In a word, simplicity.

For fun, go to /usr/include and try to understand the system .h files.

Re: Two types of C programmers

#47

C with libdispatch and clang blocks is the most fun I’ve had programming in quite some time! Here’s a web framework (complete with ORM) modeled on ExpressJS written in C: https://github.com/williamcotton/express-c The finished product is There’s also a lot of examples of the (basically required) support tooling like Valgrind, AdSan, etc. Check it out!

Carmack said low level programming is good for the soul, he's right. C is a fun programming language, don't even know why. Freestanding C with no standard library is the most fun I've had programming ever.

I'd like to share my project as well: a Lisp interpreter written in freestanding C.

https://github.com/lone-lang/lone

Re: Two types of C programmers

#48
post #32

C with libdispatch and clang blocks is the most fun I’ve had programming in quite some time! Here’s a web framework (complete with ORM) modeled on ExpressJS written in C: https://github.com/williamcotton/express-c The finished product is There’s also a lot of examples of the (basically required) support tooling like Valgrind, AdSan, etc. Check it out!

It looks cool. The DB library is appreciated. However, you would get about the same idle memory and docker size with Go's Fibers framework :)

Lol, yeah, the libdispatch runtime is probably about as big as the Go runtime!

I think this has a slight advantage in that it uses a memory arena for a per-request bump allocator so it should keep overall memory usage lower.

The slowest part of all this has to do with Block_copy and the places where I’m very much treating blocks/closures in an OOP type manner.

This could be fixed by writing a different function that did basically the same thing as Block_copy but for all the “methods” on an “object” in a single pass. But who has time for that? :D

Here’s more about those performance issues and some example code that show how slow the approach is:

https://github.com/williamcotton/express-c/tree/master/resea...

Re: Two types of C programmers

#49

C with libdispatch and clang blocks is the most fun I’ve had programming in quite some time! Here’s a web framework (complete with ORM) modeled on ExpressJS written in C: https://github.com/williamcotton/express-c The finished product is There’s also a lot of examples of the (basically required) support tooling like Valgrind, AdSan, etc. Check it out!

Carmack said low level programming is good for the soul, he's right. C is a fun programming language, don't even know why. Freestanding C with no standard library is the most fun I've had programming ever . I'd like to share my project as well: a Lisp interpreter written in freestanding C. https://github.com/lone-lang/lone

Ooh, I really like this and from a cursory glance it looks very legible, I’m definitely going to poke around later!
Post reply on HN