you are viewing a single comment's thread
view the rest of the comments
[–] 20 points 1 year ago (3 children)

that’s just how they are made.

Can confirm, even the little training compiler we made at Uni for a subset of Java (Javali) had a backend and frontend.

I can't imagine trying to spit out machine code while parsing the input without an intermediary AST stage. It was complicated enough with the proper split.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 10 points 1 year ago (1 child)

    I have built single pass compilers that do everything in one shot without an AST. You are not going to get great error messages or optimization though.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 1 year ago

    Oh! Okay, that's interesting to me! What was the input language? I imagine it might be a little more doable if it's closer to hardware?

    I don't remember that well, but I think the object oriented stuff with dynamic dispatch was hard to deal with.

  • source
  • parent