TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

I coded a Pascal compiler for transputer as a teen in 1993

180 点作者 nanochess3 个月前

18 条评论

ikari_pl3 个月前
Do you also feel like you did projects in your teen years that you wouldn&#x27;t pull off today?<p>I coded assembly (Z80) in a disk editor, having no assembler, just a handwritten list of opcodes.<p>I wrote a chat client app (in Delphi) HAVING NO INTERNET at home, I went to a cafe, recorded a dump with Wireshark, printed it on a dot matrix printer, and used a marker pen to highlight the bytes I understand the meaning of.<p>I miss it so much.
评论 #42945073 未加载
评论 #42952731 未加载
评论 #42960763 未加载
评论 #42947824 未加载
评论 #42949166 未加载
评论 #42958062 未加载
评论 #42947201 未加载
评论 #42947149 未加载
评论 #42945954 未加载
评论 #42946954 未加载
评论 #42951826 未加载
willvarfar3 个月前
Jaw droppingly awesome :)<p>Brings up a strong nostalgia from me. Around that time computers were becoming mainstream and available where I was in the UK, and I grew up acquiring old cast-off computers and tinkering. For me there was an &#x27;assembly language masterclass&#x27; book (I was a beginner and this was my first serious tech book and I had to sink or swim) that went into a lot of 32-bit programming for the 386 (which I never had) but got me far enough along. It was that and computer magazines which were really programming magazines, which were a thing and quite popular back then.<p>Remember fondly how transformative it was to move from Basic to a copy of Turbo Pascal 6 and it&#x27;s asm keyword that I got passed on a floppy disk in the playground.<p>Ah that was the time when it was just obvious that you could entertain yourself on a computer by creating things, however small, instead of just consuming them.<p>By the time I got computer games, I was thinking about them as programs not games and I got my entertainment by getting into the modding scene.
nickcw3 个月前
I loved reading this write-up. It was a wonderful trip down memory lane. Writing a PASCAL compiler is very impressive. I only got as far as the assembler!<p>In 1989 I designed and built a board with 3 transputers on it as part of my (physics) degree project. The transputers were T212 I think, so only 16 bit and no floating point with 2k of local RAM. They ran at 20 Mhz and the all important chip to chip network ran at 10 Mhz. Ostensibly it was so I could do Ising spin simulations on it but actually all I wanted to do was calculate Mandelbrot sets having seen a demo of a box with 256 transputers in doing that.<p>My transputer box was connected to a BBC Micro and to program the transputer I wrote an assembler in BBC Basic. The transputer instruction set was quite funky - everything was variable length. Which meant when calculating the jump instructions, sometimes my assembler would take 7 passes to find the optimium encoding for everything.<p>The BBC Micro only had 32k of RAM which wasn&#x27;t nearly enough RAM to hold the assembler, the symbol table and the code you were assembling. So the assembler would write each pass to disk! To floppy disk! It was very slow as you can imagine but I did end up writing both an Ising spin simulation and a Mandelbrot set plotter. The Ising spin simulator ran slightly faster than a FORTRAN version I wrote for the university mainframe which I was very pleased with.<p>I got to learn about parallel processing using message passing and managed to make my first concurrency bug where the program would work on 1, 2 but not 3 transputers! I didn&#x27;t write programs for multi-processor machines again for more than 10 years.<p>The transputer seems so ahead of its time, even now 36 years later. I sometimes wonder what it would be like if we&#x27;d continued down that path. Maybe your laptop would have 10,000 processors in it each with a few MB of RAM and we&#x27;d be writing very different programs in languages where message passing was a first class construct.
评论 #42952418 未加载
评论 #42946489 未加载
评论 #42960925 未加载
lukaslalinsky3 个月前
When I was teen moving into adulthood, I couldn&#x27;t understand why Pascal is being abandoned and people are moving into C and C++. I often think how would the software world look like if that did not happen. It&#x27;s such a shame that we lost such a simple, yet productive language, in the commercial settings. And now we have Rust as the next winning choice, language even more complex than C++.
评论 #42945365 未加载
评论 #42945325 未加载
jll293 个月前
Fantastic, well done! - I remember the Inmos Transputers (T800), and there was Occam, the curious language, from which I remember just two operators, ? and ! to read and write from the four(?) fast serial ports that connected one transputer with its neighbors.<p>Pascal was beautiful, clean, simple and fast, and computer science has never reached that height again, IMHO - look at how slow Python is, how unstructured many programs are, when python permitted nested functionsa and procedures (C&#x2F;C++&#x2F;Rust still cannot do that today). And the fast compilers, TurboPascal, TurboModula, and TurboC that made Borland famous and wealthy are in some sense also unrivalled: on machines 1000x slower than what I have now in my desk, you felt like you had the fastest PC money can buy.
评论 #42970501 未加载
jgrahamc3 个月前
Truly wonderful story and brought back a lot of memories because my 1992 DPhil thesis is in a combination of CSP and occam: <a href="https:&#x2F;&#x2F;blog.jgc.org&#x2F;2024&#x2F;03&#x2F;the-formal-development-of-secure.html" rel="nofollow">https:&#x2F;&#x2F;blog.jgc.org&#x2F;2024&#x2F;03&#x2F;the-formal-development-of-secur...</a>
lukeh3 个月前
INMOS (morally) lives on as XMOS, with its funky dialect of C (XC), which incidentally I quite enjoy.
评论 #42946261 未加载
larodi3 个月前
If I understand right you were living in Mexico at that time and not going too fancy shmancy school for rich kids?<p>If so - doubles the magnitude of this achievement.
评论 #42945990 未加载
评论 #42950408 未加载
hi_hi3 个月前
I have fond memories of Pascal. As a 16 - 17 year old in the late 90&#x27;s I developed a primitive drawing package in Turbo Pascal for a school project. The only reason I was able to achieve this was thanks to a unit (library) called VGraph which I came across on a floppy disk at a random computer fair. It was a game changer, allowing me to access high resolution modes (640 x 480 ha) previously unattainable to me, along with some other graphics primitives around line drawing and mouse cursors.<p>I still have the program source, but the required Vgraph dependency has been lost to time, so I&#x27;m sadly unable to run it. I&#x27;ve searched online but never had much luck. If this lib sounds familiar to anyone, I would love to hear about it.
wkjagt3 个月前
Awesome read. I wish I&#x27;d started programming when I was a teenager. I mean, I did some BASIC on a Commodore 64, but nothing as advanced as OP was doing in his teens.<p>By the way, I also have OP&#x27;s &quot;Programming Boot Sector Games&quot; book, which is an amazing book.
andrewstuart3 个月前
The Byte Book of Pascal I think led to the creation of a lot of Pascal implementations.
评论 #42944613 未加载
mmmlinux3 个月前
In case anyone else is unfamiliar with what a &quot;transputer&quot; is.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Transputer" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Transputer</a>
评论 #42959508 未加载
marcodiego3 个月前
Familia Toledo. They&#x27;re abnormally gifted. I wonder what could have happened if they were thrown into Linux development in the early days.
stuaxo3 个月前
A great read.<p>What&#x27;s needed to actually implement FILE, are there any transputer emulators to run this on?
评论 #42956550 未加载
marstall3 个月前
what a beautiful story. thanks for sharing, OP. shades of my own youth peeking into 6502land on my AppleIIe in the early 80s.<p>Also thanks for the Transputer deep dive, TIL!<p>Love the source code you posted on Github with its Spanish comments.
agumonkey3 个月前
Being exposed to the dragon book at that age. Interesting.
begueradj3 个月前
That was the era where we had to buy compilers to run C, Pascal ... code. That&#x27;s why even SQL had (and maybe still has) its own C compiler.
评论 #42957208 未加载
ingen0s3 个月前
Sweet. This was my first language, also in ealry 90&#x27;s