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

Show compiled Erlang #2

Open
isaacharrisholt opened this issue May 15, 2024 · 7 comments · May be fixed by #1
Open

Show compiled Erlang #2

isaacharrisholt opened this issue May 15, 2024 · 7 comments · May be fixed by #1

Comments

@isaacharrisholt
Copy link

The code for this is mostly there on the JS side (in index.js and worker.js). We just need to add the compiled Erlang stdlib to the bundle like we do with the JS stdlib in order to get compilation working.

@isaacharrisholt isaacharrisholt mentioned this issue May 18, 2024
2 tasks
@lpil
Copy link
Member

lpil commented May 18, 2024

We just need to add the compiled Erlang stdlib to the bundle like we do with the JS stdlib in order to get compilation working.

It's not possible to execute Erlang in a browser so this isn't needed!

@isaacharrisholt
Copy link
Author

Agreed we should execute the JS target, but it would be nice to show the compiled Erlang output, no?

@lpil
Copy link
Member

lpil commented May 18, 2024

Yes but you don't need to add compiled Erlang stdlib to the bundle to do that. The only thing you need to do is ask the compiler for Erlang rather than JavaScript and it'll just work.

@isaacharrisholt
Copy link
Author

I tried doing that but it complained about missing libraries

@isaacharrisholt
Copy link
Author

Here's the specific error:

error: Function without an implementation
   ┌─ /src/gleam/float.gleam:72:1
   │
72 │ fn do_round(a: Float) -> Int
   │ ^^^^^^^^^^^^^^^^^^^^^

We can't compile this function as it doesn't have an
implementation. Add a body or an external implementation
using the `@external` attribute.

@lpil
Copy link
Member

lpil commented May 19, 2024

@isaacharrisholt
Copy link
Author

Welp. Sounds about right. That'll teach me for copy-pasting stuff and then not reading it in detail 😅

Thanks! I'll add this to #1.

@isaacharrisholt isaacharrisholt linked a pull request May 19, 2024 that will close this issue
6 tasks
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

Successfully merging a pull request may close this issue.

2 participants