Live data from Hacker News

Show HN: 3D shooter in your terminal using raycasting in Awk

github.com

51–57 of 57 posts

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#51

Earlier quoted context omitted.

I used to write a fair amount of AWK code back in the day. It was great for one-liners, but I wrote some more elaborate programs in it too. I treated it seriously, like a real programming language, and it served me well. My favorite AWK program was probably my LaserJet II code listing program from 1991. I wrote this out of frustration with the terrible default listings I got when I printed source code. The AWK code d…

Years ago I wrote a compiler (for bytecode) in awk. Ummm... http://cowlark.com/mercat , although you'll need to wade through zip files to get at the source. It was 1.6kloc for a fully typed algolish language producing stack-based bytecode. awk's a lovely little language, and deserves to be better known than it is. Its two big failings are local variable syntax and absence of structured types... and the standard libra…

It looks like you fished the awk file out - I found http://cowlark.com/mercat/com.awk.txt linked directly on that page, which, at 1610 total lines (1518 SLOC counting commented-out code), sounds like exactly what you're referring to.

As for fforth.... your signoff at the end of the comments sums it up much better than anything I could say.

  # No evil was harmed in the making of this file. Probably.
This thing is absolutely awesome... a self-modifying tri-language source file, implementing Forth in just 22KB (or 34KB on x64). Very nice.

Now to go read the, um,

  panic: unrecognised word: help
...documentation? :P

It actually happens that I've recently become really interested in Forth implementations and systems, so discovering this is especially cool... and on that note, what sources would you recommend I study to get an overview of Forth history and development? I've read enough historical anecdotes to understand there are conflicting opinions (as always), but nothing thus far has shown the evolution of the language itself, how ANS became a thing, and so forth.

PS. clang-3.7 -Os is the winner on i386, gcc-5.3 -Os on x64. tcc-0.9.26, interestingly, comes second on both (26KB and 36KB respectively). (Using Slackware-current.)

PPS. Your site's About section might want to know the Antix website seems to have been taken over by a spam system.

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#52

This is beautiful. I'm reminded of an administration tool I wrote using AWK and ANSI command sequences. It was the most powerful programming language available on the machines available to me for that project. It worked great, but in the end meant that I had to fly back out to that site every time it needed maintenance or new features as nobody else there knew AWK.

Depending on whether the flights were stressful or a nice step away from home turf, that might be considered a feature, not a bug. It was a nice bit of job security, in any case.

I also hesitate to say that the site in question deserved to pay for the tickets, since AWK is reasonably easy to learn, even in the case of 4- or 5-digit-SLOC applications.

But if AWK was the most capable system available, that's saying a bit... :p

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#53
post #52

This is beautiful. I'm reminded of an administration tool I wrote using AWK and ANSI command sequences. It was the most powerful programming language available on the machines available to me for that project. It worked great, but in the end meant that I had to fly back out to that site every time it needed maintenance or new features as nobody else there knew AWK.

Depending on whether the flights were stressful or a nice step away from home turf, that might be considered a feature, not a bug. It was a nice bit of job security, in any case. I also hesitate to say that the site in question deserved to pay for the tickets, since AWK is reasonably easy to learn, even in the case of 4- or 5-digit-SLOC applications. But if AWK was the most capable system available, that's saying a b…

While the job security was nice, I considered it a personal failure as I had made a choice that resulted in less flexibility for personnel allocation for my organization.

The site in question was isolated from the Internet for security reasons. This was ~1994 and I would have had to submit significant paperwork to get permission to use one of the phone lines for a modem.

As I remember it, the site had a hodgepodge of SCO Unix, SunOS, IRIX, and Linux systems. SCO Unix was the least equipped of them. Configuration management had them all stuck at an old version. Perl wasn't even installed on all of the systems. I remember feeling that AWK was a good choice because, being interpreted, it allowed for fast development. Another obvious option would have been C with X for the GUI, but that would have taken much longer to implement.

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#54
post #52

Earlier quoted context omitted.

Depending on whether the flights were stressful or a nice step away from home turf, that might be considered a feature, not a bug. It was a nice bit of job security, in any case. I also hesitate to say that the site in question deserved to pay for the tickets, since AWK is reasonably easy to learn, even in the case of 4- or 5-digit-SLOC applications. But if AWK was the most capable system available, that's saying a b…

While the job security was nice, I considered it a personal failure as I had made a choice that resulted in less flexibility for personnel allocation for my organization. The site in question was isolated from the Internet for security reasons. This was ~1994 and I would have had to submit significant paperwork to get permission to use one of the phone lines for a modem. As I remember it, the site had a hodgepodge of…

> While the job security was nice, I considered it a personal failure as I had made a choice that resulted in less flexibility for personnel allocation for my organization.

Good way to put it, and point conceded (and filed away for future reference in my own life).

> The site in question was isolated from the Internet for security reasons. This was ~1994 and I would have had to submit significant paperwork to get permission to use one of the phone lines for a modem.

I figured as much. Usually flying someone out only happens when the core infrastructure is out (and the tiny DSL emergency modem failed as well), when something's being so annoying/intermittent it has to be poked onsite, or when something's airgapped.

> As I remember it, the site had a hodgepodge of SCO Unix, SunOS, IRIX, and Linux systems. SCO Unix was the least equipped of them. Configuration management had them all stuck at an old version. Perl wasn't even installed on all of the systems.

Ouch, wow. (I'm not sure whether to be more impressed that Linux made an appearance at all only 3 years after entering existence, or that it was apparently stable enough at that point to not be laughed out of the building.)

> I remember feeling that AWK was a good choice because, being interpreted, it allowed for fast development.

A problem that's still a toss-up for many people :) hah. I'm not even sure what to use half the time...

> Another obvious option would have been C with X for the GUI, but that would have taken much longer to implement.

Ah, the joys of Xlib. I've poked it briefly but not too much, although I can resonate with the "much longer to implement" part... heh

Re: Show HN: 3D shooter in your terminal using raycasting in Awk

#55
post #54

Earlier quoted context omitted.

While the job security was nice, I considered it a personal failure as I had made a choice that resulted in less flexibility for personnel allocation for my organization. The site in question was isolated from the Internet for security reasons. This was ~1994 and I would have had to submit significant paperwork to get permission to use one of the phone lines for a modem. As I remember it, the site had a hodgepodge of…

> While the job security was nice, I considered it a personal failure as I had made a choice that resulted in less flexibility for personnel allocation for my organization. Good way to put it, and point conceded (and filed away for future reference in my own life). > The site in question was isolated from the Internet for security reasons. This was ~1994 and I would have had to submit significant paperwork to get per…

> I'm not sure whether to be more impressed that Linux made an appearance at all only 3 years after entering existence, or that it was apparently stable enough at that point to not be laughed out of the building.

I was young and so was Linux. I was the only available Linux guy at that time in that organization. The site was running some experiments for military training simulators, so it wasn't uncommon to use technology that wasn't yet mainstream. If I remember correctly, it was just being used to translate some data from one system and inject it into another.

Post reply on HN