TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Bournegol – Algol-like dialect of C used to write the original Bourne shell

50 pointsby carljosephover 10 years ago

4 comments

mhdover 10 years ago
Reminds me of an intro to programming book in German that I once had, covering different styles from imperative to OO. Not even that old, late 90s I guess. But I guess the author just had to use C, even if he&#x27;d have preferred Pascal. So the very first thing the book does is introduce a boatload of preprocessor macros to make it look like Pascal. A weird way to start out if you had some prior C experience…<p>Then again, for short academic programs it probably won&#x27;t cause that much confusion, having running code is more a side-effect of that, so it&#x27;s a bit like executable pseudocode.<p>It does make me wonder what&#x27;s the biggest program out there that&#x27;s been written with heavy preprocessor abuse. Then again, not sure whether I&#x27;d really wanna know…
simiasover 10 years ago
I thought it was amusing until I read that:<p><pre><code> #define LOBYTE 0377 #define STRIP 0177 #define QUOTE 0200 </code></pre> I can deal with preprocessor abuse but octal crosses the line...<p>Also, in case anybody would have the bad idea to take inspiration from that code, don&#x27;t do that:<p><pre><code> #define MAX(a,b) ((a)&gt;(b)?(a):(b)) </code></pre> It evaluates the macro parameters twice.<p>Although, on second thought, don&#x27;t do anything like that code anyway.
评论 #8802459 未加载
fernlyover 10 years ago
This is an interesting sort of forerunner to another topic in yesterday&#x27;s HN [1], Cello [2], which appears to be essentially a more thorough, and better-grounded version of Bournegol.<p>[1] <a href="https://news.ycombinator.com/item?id=8799070" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=8799070</a><p>[2] <a href="http://libcello.org/" rel="nofollow">http:&#x2F;&#x2F;libcello.org&#x2F;</a>
sduclosover 10 years ago
Wonder the rational for<p><pre><code> #define TRUE (-1) #define FALSE 0 </code></pre> instead of<p><pre><code> #define TRUE (1==1) #define FALSE !TRUE </code></pre> edit: re-formatting
评论 #8803078 未加载