alpaca-lang / rebar_prv_alpaca

rebar3 plugin for compiling alpaca modules
Other
11 stars 5 forks source link

Add nicer error formating and fail on errors #16

Closed Licenser closed 7 years ago

Licenser commented 7 years ago

1) Add some nicer output for errors (or the error I found) 2) error on errors and don't continue.

The error: download-2

I'll happily add more over time.

Licenser commented 7 years ago

Also doing syntax errors now: image

lepoetemaudit commented 7 years ago

Wow! This is really beautiful, really excited to see errors that look like this!!

There are two snags though:

  1. There is already some work on formatting errors within Alpaca itself: see https://github.com/alpaca-lang/alpaca/blob/master/src/alpaca_error_format.erl. This allows the errors to be translated. I would really love to see if this level of error reporting could be added to Alpaca itself with the translations, but also with the colours and formatting you've added. @j14159 any thoughts on this? It would be great if we could also provide options to show/hide parts of the output and also make the colours optional.

  2. The rebar plugin is being rewritten quite a lot to take advantage of new Alpaca features (allows for things like incremental builds, auto-imported modules and a few other things) but Alpaca in future will need to be 'installed' rather than compiled per application as parts of the compiler are now built in Alpaca itself. The rewrite also uses Alpaca's own error formatter to display errors (as does the shell, incidentally) so if we can get your work into Alpaca itself, everywhere will benefit automatically.

Licenser commented 7 years ago

More then happy to move that to the alpaca repo. It just ended up here since I felt more qualified to contribute to a rebar3 plugin ;).

j14159 commented 7 years ago

@lepoetemaudit good catch, I think you're right that this does indeed make sense in the compiler itself.

j14159 commented 7 years ago

Also @Licenser I'm happy to help and/or answer any questions you have about the compiler guts. Some of it is...a little byzantine :)

Licenser commented 7 years ago

Awesome, I'll bug you on IRC if I run into trouble, I'll take a crack at it later tonight ^.^

Licenser commented 7 years ago

A bit late but: https://github.com/alpaca-lang/alpaca/pull/181 should we close this and move it to alpaca core entirely?

j14159 commented 7 years ago

@Licenser I'm fine with that, will leave it up to you.

Licenser commented 7 years ago

then lets do it ;)