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

Improvements to runtime initialization #201

Merged
merged 4 commits into from
Apr 16, 2021
Merged

Improvements to runtime initialization #201

merged 4 commits into from
Apr 16, 2021

Conversation

josevalim
Copy link
Contributor

  1. Do not use nouse_stdio as it causes slowdowns when IEx
    is also running

  2. Reduce the amount of generated random atoms by using the
    child_node as the name of the parent process

  3. Do not pass quoted strings to Windows to eval, use argv
    instead

Closes #194.

1. Do not use nouse_stdio as it causes slowdowns when IEx
   is also running

2. Reduce the amount of generated random atoms by using the
   child_node as the name of the parent process

3. Do not pass quoted strings to Windows to eval, use argv
   instead

Closes #194.
Copy link
Member

@jonatanklosko jonatanklosko left a comment

Choose a reason for hiding this comment

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

Interesting issue, great you figured it out :D @juhalehtonen thanks a lot for helping with that ❤️

@josevalim
Copy link
Contributor Author

@jonatanklosko we also had to remove newlines from the evaluated code. If we need to change this code, we should consider writing to a file and asking Elixir to evaluate the file instead. We could even ship this file in priv inside livebook, especially because I rewrote it to receive arguments from System.argv, so it no longer differs per node.

@josevalim josevalim merged commit 8a17130 into main Apr 16, 2021
@josevalim
Copy link
Contributor Author

💚 💙 💜 💛 ❤️

@josevalim josevalim deleted the jv-windows branch April 16, 2021 10:31

if @child_node_eval_string =~ "\n" do
raise "invalid @child_node_eval_string, newline found: #{inspect(@child_node_eval_string)}"
end
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it be cleaner to String.replace("\n", ";") on the formatted code instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You can't have two ; in a row. So if you have two newlines, it would fail. We could handle all of these cases, squeeze, and so on but I preferred to write the abomination above for now.

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.

Starting a standalone Elixir runtime fails on Windows 10
2 participants