thelastpsion,
@thelastpsion@bitbang.social avatar

I have come to the conclusion that compiler writing is in my future. I have repeatedly told myself it's a terrible idea. I have even publicly said I'm not going to do it unless someone pays me a lot of money.

But the money won't happen. I know I'm going to do it anyway.

It's a next year problem. I have other projects to complete first, plus It'll take me at least that long to gain a fraction of the knowledge I need to start.

CTRAN was the start, and it gave me a tiny taste. I even liked it.

bread80,
@bread80@mstdn.social avatar

@thelastpsion Sounds fun. Painful. But fun.

thelastpsion,
@thelastpsion@bitbang.social avatar

As of right now, the feature list (subject to change, due to my current limited knowledge) is:

Compiler for EPOC16

  • Target: 8086; NEC V20 extensions
  • Language: C89, some C99 features; Objective-C extensions
  • Replicate the output of JPI/Clarion TopSpeed C 3.10 as closely as possible (pure small memory model)
  • Runs on: Linux, HaikuOS, Windows, *BSD
  • Written in: TBD. Pascal/Rust?/OCaml? (can't use Go as there's no port for Haiku yet)

I can't emphasise enough: I DO NOT KNOW WHAT I'M DOING!

M0CUV,
@M0CUV@mastodon.radio avatar

@thelastpsion if you’d like a collaborator, I’d be happy to help.. I’ve not written a C compiler before from scratch, but it has been on my transputer projects list, after finishing eForth, and alongside starting a new occam compiler. I have written a MASM6-ish transputer assembler, and you’ll need an assembler (and linker) as well. If you’d be happy to have it target both EPOC16/TopSpeed and transputer, wouldn’t mind learning Rust and fully TDDing it… ?

thelastpsion,
@thelastpsion@bitbang.social avatar

@M0CUV Thank you for asking! I'll have to let you know nearer the time. I've got other projects to finish and a lot to learn before I can even begin to think about starting this one.

M0CUV,
@M0CUV@mastodon.radio avatar

@thelastpsion Sure, I have to at least get unstuck with my current radio project (nearly done, but have fallen down a study rabbit hole of Fast Fourier Transform) and get eForth out. I’ll need to build a Psion emulator & tool chain VM..

M0CUV,
@M0CUV@mastodon.radio avatar

@thelastpsion … I’ve settled on Rust as my main language for all new projects other than quick-and-dirty projects that I use Perl for. If the JVM is a possibility, it’s Scala or Java (the transputer assembler is in Scala). Go, maybe, but it’s not on your target list (I’d want to add macOS too) . Full disclosure: I have a moderate idea of what’s involved, and have boundless naïve enthusiasm :) I’d also really like to collaborate on something as all my stuff so far has been solo.

M0CUV,
@M0CUV@mastodon.radio avatar
thelastpsion,
@thelastpsion@bitbang.social avatar

@M0CUV I've seen this! She's one of the people that I saw mentioning OCaml for compiler writing. In fact, I think she used it for the book. https://norasandler.com/2017/11/29/Write-a-Compiler.html

M0CUV,
@M0CUV@mastodon.radio avatar

@thelastpsion I hadn’t gone into it much, but I agree when she writes “You can implement the compiler in whatever language you like, but I’d recommend using a language with sum types and pattern matching like OCaml, Haskell, or Rust” (or Scala, but I’m itching to try the Rust “nom” parser combinator library)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines