Hacker News new | past | comments | ask | show | jobs | submit | spc476's comments login

But then the interviewer will be launched into the Pit of Eternal Peril.


Wait! I thought President Trump was getting ride of the Department of Education. How is there still an Education Secretary?


The Motorola 68000, introduced in 1979, had 24 address lines. The Intel 80286, introduced in 1982, also had 24 address lines.


Well, the VAX was there before any of these, but I wouldn't call that a "personal machine."

I suppose the argument could be made that the 68000 was first, as both it and MIPS ended up in gaming consoles (Sega Genesis vs. Sony PS2 and Nintendo 64).

However, MIPS eventually scaled to 64-bit, was well-known and heavily exploited in supercomputing applications, and was used to produce the film Jurassic Park. The 68000 had a far dimmer future.

Yes, the x86 line did supplant them all, but only with AMD's help. Had Itanium been Intel's final answer, MIPS might be much stronger today.


Here's a recent attempt to load code via video recordings of a TV show from the 80s. It wasn't an easy task. From the Youtube channel Retro Recipies:

Decoding A Program Sent From The Past: https://www.youtube.com/watch?v=MezkfYTN6EQ

Did We Decode A Program Sent From The Past?: https://www.youtube.com/watch?v=VRcs_TUpQ6g

ACTUALLY Receiving A Program Sent From The Past!:https://www.youtube.com/watch?v=jm0EACgCbM0&t=1203s


That’s exactly the sort of thing I was hoping someone would have done. Thanks for sharing!


For adapting code to different versions of libraries for one thing:

    #if defined(__SunOS)
        presult = getprotobyname_r(proto,&result,tmp,sizeof(tmp));
        if (presult == NULL)
          return luaL_error(L,"protocol: %s",strerror(errno));
    #elif defined(__linux__)
        if (getprotobyname_r(proto,&result,tmp,sizeof(tmp),&presult) != 0)
          return luaL_error(L,"protocol: %s",strerror(errno));
    #else
        presult = getprotobyname(proto);
        if (presult == NULL)
          return luaL_error(L,"protocol: %s",strerror(errno));
        result = *presult;
    #endif
The sometimes annoyingly small differences between platforms.


Oh, I think you missed something then:

There is both `$if` and `$switch` compile time statements for this: https://c3-lang.org/generic-programming/compiletime/#if-and-...

At the top level and `@if` attribute is used to achieve the same thing: https://c3-lang.org/language-common/attributes/#if


Ah. The top-level lang description claims “No preprocessor”, but my definition of that word doesn’t appear to be the same as yours :/


The difference here is that a preprocessor runs before parsing and semantic analysis. In C3 compile time if runs in the analysis step, so after parsing.

So the macros and compile time execution occurs after parsing in C3, but in C everything happens at lexing, before the code is parsed.


That strategy will backfire when the grammar changes in a later release. A pre-parse step is necessary for code that targets different compiler releases.


Now I'm confused, what do you mean? What grammar changes?


Imagine v2.0 introduces a new feature that requires a parser change—one that v1.0 wouldn't be able to parse.

  $if $defined(C3_V2_PLUS):  
      // new feature
      fn f = \ -> foo(); // this won't parse in v1.0
  $else
      Callback f = ...;
  $endif
This is also an issue if a future version of C3 introduces language level support, allowing newer compilers to compile code as if it were written for an earlier version. While this approach works well when teams standardize on a specific version’s feature set, they may still want to take advantage of performance improvements in the latest compiler.

That said, this is a niche case and not something I’d consider a dealbreaker.


You don't need an ifdef.

You just need a CLI option like java's --source, where you specify the source compatibility with different language versions.


You do, that's the point here. You need ifdefs in this example to selectively compile the same code with different compilers, or different language levels with the same compiler. In either case C3 will fail while parsing a newer feature with an older compiler or lang level.


This exact situation is there in Java, using compiler args, after lambda functions were introduced. Older compilers would not be able to handle it, and the newer compilers would not break backward compatibility.


And. . . Java does not have conditional compilation.


Ah, that is indeed true. However, the plan is to have the language fixed at 1.0, only updating stdlib and tooling after that.


Well, if your language gains traction that plan may not succeed. For your sake, I hope that's the case :)


I know it’s hard.


That one was missing a comma: "I know, it's hard". I'll do my best.


Sure. Here's viola, a web browser from the early 90s, with a replacement makefile (GNU make) that's a bit more sane:

    CC      = gcc -std=c99 -Wall -Wextra -pedantic
    CFLAGS  = -g
    LDFLAGS = -g
    LDLIBS  = -L/usr/X11R6/lib -lICE -lSM -lXpm -lX11 -lXext -lXmu -lXt -lm

    VIOLA_PATH := $(shell pwd)/resources

    override CFLAGS += -DPOSIX_C_SOURCE=199309L         \
                    -D_POSIX_SOURCE -D_XOPEN_SOURCE     \
                    -D_BSD_SOURCE -D_SVID_SOURCE        \
                    -DDEFAULT_VIOLA_PATH='"$(VIOLA_PATH)"'\
                    -DVIOLA

    %.a:
            $(AR) $(ARFLAGS) $@ $?

    viola/viola: $(patsubst %.c,%.o,$(wildcard viola/*.c)) \
                    libIMG/libIMG.a     \
                    libXPA/src/libxpa.a \
                    libStyle/libStyle.a \
                    libWWW/libWWW.a     \
                    parmcheck.o

    libIMG/libIMG.a     : $(patsubst %.c,%.o,$(wildcard libIMG/*.c))
    libXPA/src/libxpa.a : $(patsubst %.c,%.o,$(wildcard libXPA/src/*.c))
    libStyle/libStyle.a : $(patsubst %.c,%.o,$(wildcard libStyle/*.c))
    libWWW/libWWW.a     : $(patsubst %.c,%.o,$(wildcard libWWW/*.c))

It's 155,000 lines of C code across 361 files. Not shown are the nearly 900 lines that make up the dependencies, but using `makedepend` (which came with my system) makes short work of that. I have a more complicated project that compiles an application written in Lua into a Linux executable. It wasn't hard to write, given that you can always add new rules to `make`, such as converting a `.lua` file to a `.o` file:

    %.o : %.lua
            $(BIN2C) $(B2CFLAGS) -o $*.l.c $<
            $(CC) $(CFLAGS) -c -o $@ $*.l.c
            $(RM) $*.l.c
Okay, that requires a custom tool (`bin2c`) but can other build systems do this? I honestly don't know.


There is Mathematics for the Million by Lancelot Hogben, which not only covers math, but the history of math and why it was developed over the centuries. It starts with numbers, then geometry, arithmetic, trig, algebra, logarithms and calculus, in that order. It's a very cool book.


I was going to say the same! I got it years ago, it's hard to top a math book with a quote from a certain Al Einstein on the back cover singing its praises! Morris Kline's "Mathematics for the Nonmathematician" takes a similar approach, as I believe other books by the author do. Can also recommend "Code" by Charles Petzold and "The Information" by James Gleick, while not comprehensive they do cover the development of key mathematical insights over time.


Unless "platform engineers" includes "deveopers", they're not the only ones who can diagnose an issue. Once at my previous job (providing a name based on a phone number to the Oligarchic Cell Phone companies), our service just stopped. I wasn't there during the outage, only heard about it after the fact. The servers were fine (they were not out of memory, nor did they have an outrageous load). The network was fine. The program just wasn't serving up data. There had been no recent updates to the code [1] so it shouldn't have been the software. It took the main developer, who knew the code, to know that a "this should not happen" situation, did---that is, the name query we used for a health check had been removed, and thus our software took that to mean the name service was out of commission, thus shutting down.

Now, it could be argued that was the wrong thing for our software to do, but it was what it was, and no amount of SREs or "platform engineers" would have solved the issue (in my opinion).

[1] The Oligarchic Cell Phone companies do not move fast, and they had veto power over any updates to production.


If I didn't want to have opinions, I would join a cult.


You're welcome to your opinions, I don't stop engineers I'm working with from having opinions about the code formatting. It's still going to be formatted by the opinionated formatter.

Having one gets us into the "Well, it's not quite what I want but at least it's consistent", and it gets rid of arguments that don't really provide anywhere near the amount of value engineers feel they do. There are almost always significantly better and more productive things to be spending time figuring out.


save your opinions for the things that really matter instead of another bikeshed to build! (not telling you to shut up, btw :) )


At $PREVIOUS_JOB, the team I was on worked the best when we had no manager. Or rather, we had a director (who should not have been managing us directly) meet with us once a week to tell us "here's what we're headed ... good?" and let us go work in quiet until the next meeting (or meet with us sooner if something really important cropped up).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: