Readit News logoReadit News
_kst_ commented on Tiny C Compiler   bellard.org/tcc/... · Posted by u/guerrilla
pbohun · 4 days ago
There also is an unofficial mirror which has updates.

https://github.com/TinyCC/tinycc

_kst_ · 4 days ago
That has the same content as git://repo.or.cz/tinycc.git
_kst_ commented on 4 billion if statements (2023)   andreasjhkarlsson.github.... · Posted by u/damethos
_kst_ · 2 months ago
The author missed an opportunity for a much shorter solution for the given problem statement.

    // Check whether a number is odd or even.

    #include <stdio.h>
    #include <stdlib.h>
    #include <stdbool.h>

    static bool is_odd_or_even(unsigned long num) {
        return true;
    }

    int main(int argc, char **argv) {
        const unsigned long num = strtoul(argv[1], NULL, 10);
        printf("%lu is %s odd or even\n",
               num,
               is_odd_or_even(num) ? "is" : "is not");
    }

_kst_ commented on Dependable C   dependablec.org/... · Posted by u/RossBencina
agumonkey · 2 months ago
What would you say C is beyond the high-level assembler ? genuinely curious (i kinda hold that belief personally but i'm not a c programmer by trade)
_kst_ · 2 months ago
I see a huge semantic gap between assembly language and C.

An assembly language program specifies a sequence of CPU instructions. The mapping between lines of code and generated instructions is one-to-one, or nearly so.

A C program specifies run-time behavior, without regard to what CPU instructions might be used to achieve that.

C is at a lower level than a lot of other languages, but it's not an assembly language.

_kst_ commented on The Pragmatic Programmer: 20th Anniversary Edition (2023)   ahalbert.com/technology/2... · Posted by u/ahalbert2
smingo · 3 months ago
I got on very well with Van der Linden's Deep C Secrets. It's from 1994, so misses out on the newer versions, but aside from that it's aged well, IMHO.

And good news: it's been open sourced: https://freecomputerbooks.com/Expert-C-Programming-Deep-C-Se... and its well regarded on Hacker News https://hackernewsbooks.com/book/expert-c-programming-deep-c... .

_kst_ · 3 months ago
Are you sure it's been open sourced? I'm reasonably sure you've linked to a site offering pirated copies.

There are several links to PDF versions of the book. None of them include either a copyright page or a statement that it's been released as open source.

The author's own website <https://afu.com/> includes errata for the book, but doesn't provide or mention a free copy.

A free sample of the Kindle version of the book does include a copyright notice. A book published in 1994 is not public domain unless it's been explicitly released.

Something that appears to be a legitimate PDF sample (not the while book) is here:

https://ptgmedia.pearsoncmg.com/images/9780131774292/samplep...

_kst_ commented on Fire destroys S. Korean government's cloud storage system, no backups available   koreajoongangdaily.joins.... · Posted by u/ksec
725686 · 4 months ago
In my twenties I worked for a "company" in Mexico that was the official QNX ditribuitor for Mexico and LatAm. I guess the only reason was that Mexico City's Metro used QNX, and every year they bought a new license, I don't know why. We also did a couple of sales in Colombia I think, but was a complete shit show. We really just sent them the software by mail, and they had all sorts of issues getting it out of customs. I did get to go to a QNX training in Canada, which was really cool. Never got to use it though.
_kst_ · 4 months ago
I think you meant to post this comment here: https://news.ycombinator.com/item?id=45481892
_kst_ commented on We shouldn't have needed lockfiles   tonsky.me/blog/lockfiles/... · Posted by u/tobr
deathanatos · 6 months ago
> that "lockfiles" are an NPM-specific feature

… they're not, though. Python & Rust both have lockfiles. I don't know enough Go to say if go.sum counts, but it might also be a lockfile. They're definitely not unique to NPM, because nothing about the problem being solved is unique to NPM.

_kst_ · 6 months ago
OK, but to me a "lockfile" is a file whose existence signals that some resource is locked.

https://en.wikipedia.org/wiki/File_locking#Lock_files

When I saw the title "We shouldn't have needed lockfiles", I expected something about preferring some other mechanism for resource locking.

More generally, I see a lot of articles that talk about an issue in some language or framework that don't mention that context. Just adding "JavaScript" or "NPM" (or whatever) in the title or near the top of the article would be very helpful.

_kst_ commented on We shouldn't have needed lockfiles   tonsky.me/blog/lockfiles/... · Posted by u/tobr
_kst_ · 6 months ago
The author seems to have assumed that readers are going to know that he's talking about NPM and JavaScript, and that "lockfiles" are an NPM-specific feature (to me, it means something completely different).

Perhaps that's a valid assumption for readers of his blog, but once it appears here there are going to be a lot of readers who don't have the context to know what it's about.

Can an "NPM" tag be added to the subject of this post? More generally, I encourage authors to include a bit more context at the top of an article.

_kst_ commented on Replacing tmux in my dev workflow   bower.sh/you-might-not-ne... · Posted by u/elashri
fouc · 6 months ago
I've always found screen's ctrl-a is so much easier to reach for than tmux's ctrl-b. I recommend re-mapping ctrl-b to ctrl-a
_kst_ · 6 months ago
I use Ctrl-Space.

    unbind-key C-b
    set -g prefix C-Space
    bind-key C-Space send-prefix
I find it a lot easier to type than either Ctrl-A or Ctrl-B.

_kst_ commented on Programmers aren’t so humble anymore, maybe because nobody codes in Perl   wired.com/story/programme... · Posted by u/Timothee
drewcoo · 6 months ago
Perl is not an acronym.
_kst_ · 6 months ago
Not officially, but there are a couple of retronyms.

Larry Wall originally wanted to call it "Pearl", but found there was already a language by that name, so he shortened it to "Perl".

The name is sometimes expanded as "Practical Extraction and Report Language", or as "Pathologically Eclectic Rubbish Lister" (Larry Wall's own phrase, mentioned in the Perl man page).

But yes, "Perl", not "PERL", is the correct name for the language.

(Ada, which was named after a person, has had the same problem, though as far as I know there isn't even a retronym for Ada.)

_kst_ commented on Phrase origin: Why do we "call" functions?   quuxplusone.github.io/blo... · Posted by u/todsacerdoti
_kst_ · 7 months ago
Algol 60 also uses the word "call" for parameters as well as functions. It introduced (?) the terms "call by value" and "call by name". For example, in 4.7.5.3: "In addition if the formal parameter is called by value the local array created during the call will have the same. subscript bounds as the actual array."

In modern terminology, we call procedures/functions/subroutines and pass arguments/parameters, so "pass by (value|name|reference)" is clearer than "call by (value|name|reference)". But the old terms "call by value" et al have survived in some contexts, though the idea of "calling" an argument or parameter has not.

u/_kst_

KarmaCake day2255March 20, 2012
About
Keith.S.Thompson+hn@gmail.com
View Original