Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Porting to PolyML #4

Open
LdBeth opened this issue May 8, 2019 · 16 comments
Open

Porting to PolyML #4

LdBeth opened this issue May 8, 2019 · 16 comments

Comments

@LdBeth
Copy link
Contributor

LdBeth commented May 8, 2019

See 36d8c33

Most part of smlnj-lib can run on polyml after minor patches, porting to poly has following benefits:

  • standalone executable Compiler exe #2
  • 64 bit support
  • clean up code
  • better debugger
  • I can compile poly on my Mac but it does not apply to smlnj
@ice1000
Copy link
Member

ice1000 commented May 8, 2019

How can I build MLPolyR with PolyML ATM?

@LdBeth
Copy link
Contributor Author

LdBeth commented May 8, 2019

it is not ready yet, I'm checking the non standard derivations in source and once all the files are
listed in
https://github.com/owo-lang/MLPolyR/blob/polyml/load.sml it should be ready to build and I'll
update Makefile

@LdBeth
Copy link
Contributor Author

LdBeth commented May 8, 2019

Now you can run make check which only use compiler to check programs and produce no executable.

@anqurvanillapy
Copy link
Member

LdBeth good good

@LdBeth
Copy link
Contributor Author

LdBeth commented May 9, 2019

Now both ml-lex ml-yacc are ported to polyml and can be compiled to stand alone complex and can be used to generate grammar. e601f7f

Shall we create new repo and submodule them?

@ice1000
Copy link
Member

ice1000 commented May 9, 2019

Can't we just provide several Makefiles that uses different toolchains?

@LdBeth
Copy link
Contributor Author

LdBeth commented May 9, 2019

That’s tedious. I’d use autotools or something. Building systems aren’t compatible across sml implementations, and some enforce special source code layout, ie file and directory name must match module layout, can not get it work out of box.

@ice1000
Copy link
Member

ice1000 commented May 9, 2019

Oh my god. How about keep several branches?

@ice1000
Copy link
Member

ice1000 commented May 10, 2019

How can I build a compiler exe? Currently check only prints 13..

@LdBeth
Copy link
Contributor Author

LdBeth commented May 10, 2019

syntax tree representation uses SML/NJ compiler components, I haven’t figured if there’s proper replacement yet

@ice1000
Copy link
Member

ice1000 commented May 10, 2019

Can we add SML/NJ compiler itself as a dependency?

@ice1000
Copy link
Member

ice1000 commented May 10, 2019

If so, we can completely remove SML/NJ backend and use PolyML only. Thus no branches needed.

Edit: s/MLton/PolyML/rg

@LdBeth
Copy link
Contributor Author

LdBeth commented May 15, 2019

Ok, I'll drop support for SML/NJ and rewrite using similar but simpler components from Tiger

@LdBeth
Copy link
Contributor Author

LdBeth commented May 17, 2019

8b63bee

Now make check would produce an executable check and it can be used to syntax check & type check MLPolyR programs. Exit with 0 means it is ok otherwise means not ok. Notice that sometimes it says nothing when failed. To get the exit status of last command, in bash or ksh you can type

echo $?

for last command exit status.

螢幕快照 2019-05-17 下午12 30 12

螢幕快照 2019-05-17 下午12 29 21


I'm still working on figure out how to properly report parse/type errors since the original error report facility heavily relies on SML/NJ's compiler component and at current Poly/ML port these facilities are basically placeholders.

@ice1000
Copy link
Member

ice1000 commented May 17, 2019

tql

@anqurvanillapy
Copy link
Member

such a breakthru

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants