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

Add Erlang language run support. #1108

Merged
merged 5 commits into from
Mar 12, 2024

Conversation

AndyShen2006
Copy link
Contributor

For the program cannot support erlang file currently, I edited the packages.json in order to support erlang.

@AndyShen2006
Copy link
Contributor Author

result

package.json Outdated
@@ -184,7 +184,8 @@
"fortran_fixed-form": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"fortran": "cd $dir && gfortran $fileName -o $fileNameWithoutExt && $dir$fileNameWithoutExt",
"sml": "cd $dir && sml $fileName",
"mojo": "mojo run"
"mojo": "mojo run",
"erlang": "cd $dir && erlc $fileName && erl -noshell -s $fileNameWithoutExt start -s init stop"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems that start is a dynamic value? Any better way to improve this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use escript to take the place of this command. Since Erlang use VM and we can specify the entrance function, the guide I'm learning uses start as entrance. However, I found that I can use escript to run short Erlang programs and this program use main as entrance. In other words, I can use erlc $filename && erl -noshell -s $fileNameWithoutExt main -s init stop, which maybe equals to escript $filename. But it seems that escript is the best way solve this problem, so I use it at last.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

屏幕截图_20240311_143310

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
Copy link
Owner

@formulahendry formulahendry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me now! Just leave two small comments.

AndyShen2006 and others added 2 commits March 12, 2024 12:33
Co-authored-by: Jun Han <formulahendry@gmail.com>
Co-authored-by: Jun Han <formulahendry@gmail.com>
@AndyShen2006
Copy link
Contributor Author

Done.

@formulahendry formulahendry merged commit 832a58f into formulahendry:master Mar 12, 2024
3 checks passed
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 this pull request may close these issues.

2 participants