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

Crystal on Windows. #2569

Closed
jkthorne opened this issue May 7, 2016 · 15 comments
Closed

Crystal on Windows. #2569

jkthorne opened this issue May 7, 2016 · 15 comments

Comments

@jkthorne
Copy link
Contributor

jkthorne commented May 7, 2016

There was a comment from someone on the last release of Crystal.
http://crystal-lang.org//2016/05/05/crystal-0.16.0-released.html#comment-2663233814

What is crystals story on windows?

@ysbaddaden
Copy link
Contributor

Windows target can come in two flavors:

  • Cygwin target (POSIX);
  • native Windows port.

The Cygwin target may not be too hard to achieve, since it's POSIX and most libraries seem to be compatible (I'm not sure about unwind thought). The problem is that it requires a Cygwin environment to compile with Crystal (not just to build Crystal itself), but most importantly to link against cygwin.dll which is GPLv3, so any Crystal application will have to be GPLv3 compatible or pay a fee to have a commercial licence.

A native port would integrate better —I'm not sure what devtools will be required thought, but require hard work. Windows isn't a POSIX platform, and thus everything related to Time, Exceptions, Sockets or Threads among others, must be fully reimplemented to use the Windows API.

That being said, there are already other issues about Windows.

@ysbaddaden
Copy link
Contributor

Oh, and we would ❤️ ❤️ ❤️ a Windows port, of course!

Part of the problem is that nobody of the core team uses Windows, as far as I know. We don't know neither it's devtools or it's API. It would thus take a tremendous effort to work on a Windows port.

@waterlink
Copy link
Contributor

I believe that the new windows feature (in beta), that allows linux
binaries to run natively on Windows should allow Crystal to "just work".
Probably, Ubuntu binaries would do the trick.

Best Regards,
Oleksii Fedorov,
Programmer,
Software Craftsman (http://manifesto.softwarecraftsmanship.org/),
TDD, Pair-Programming, Microservices, Good Architecture, Ruby, Clojure, Go,
a bit of Web Frontend and more,
Follower of Software Engineering Code of Ethics (
http://www.acm.org/about/se-code),
+49 15757 486 476

On Sun, May 8, 2016 at 8:17 AM, Julien Portalier [email protected]
wrote:

Oh, and we would [image: ❤️] [image: ❤️] [image: ❤️] a
Windows port, of course!

Part of the problem is that nobody of the core team uses Windows, as far
as I know. We don't know neither it's devtools or it's API. It would thus
take a tremendous effort to work on a Windows port.


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#2569 (comment)

@ysbaddaden
Copy link
Contributor

I don't know. This is the inverse of WINE and terminal-only (AFAIK). It brings the UNIX command-line experience to windows, but that's about it. If it's only to build terminal applications, or tart the playground, maybe that's enough. But can you build Windows applications? Maybe by hacking the SampleApp so you can bundle a built binary, but you'll still be limited to cmd.exe.

So, no, in the foreseeable future, this doesn't look like a realistic solution.

@vaartis
Copy link

vaartis commented May 8, 2016

@waterlink i actually remeber somebody building crystal under that ubuntu-in-windows thingy, it was crashing due to the RAM limitation (it's only 1 GB) tho

@waterlink
Copy link
Contributor

Oh I see. Crystal needs just a bit more RAM at the moment. What I
understand in where currently Crystal goes (all new required type
annotations), it will be possible to compile crystal programs (and crystal
itself) on per-module basis, which should reduce the RAM required.

Best Regards,
Oleksii Fedorov,
Programmer,
Software Craftsman (http://manifesto.softwarecraftsmanship.org/),
TDD, Pair-Programming, Microservices, Good Architecture, Ruby, Clojure, Go,
a bit of Web Frontend and more,
Follower of Software Engineering Code of Ethics (
http://www.acm.org/about/se-code),
+49 15757 486 476

On Sun, May 8, 2016 at 10:23 AM, TyanNN [email protected] wrote:

@waterlink https://github.com/waterlink i actually remeber somebody
building crystal under that ubuntu-in-windows thingy, it was crashing due
to the RAM limitation (it's only 1 GB) tho


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2569 (comment)

@waterlink
Copy link
Contributor

And ubuntu-in-windows thingy I believe has apt-get, so maybe it is
possible to simply install the Crystal binary?

Best Regards,
Oleksii Fedorov,
Programmer,
Software Craftsman (http://manifesto.softwarecraftsmanship.org/),
TDD, Pair-Programming, Microservices, Good Architecture, Ruby, Clojure, Go,
a bit of Web Frontend and more,
Follower of Software Engineering Code of Ethics (
http://www.acm.org/about/se-code),
+49 15757 486 476

On Sun, May 8, 2016 at 10:30 AM, Oleksii Fedorov [email protected]
wrote:

Oh I see. Crystal needs just a bit more RAM at the moment. What I
understand in where currently Crystal goes (all new required type
annotations), it will be possible to compile crystal programs (and crystal
itself) on per-module basis, which should reduce the RAM required.

Best Regards,
Oleksii Fedorov,
Programmer,
Software Craftsman (http://manifesto.softwarecraftsmanship.org/),
TDD, Pair-Programming, Microservices, Good Architecture, Ruby, Clojure,
Go, a bit of Web Frontend and more,
Follower of Software Engineering Code of Ethics (
http://www.acm.org/about/se-code),
+49 15757 486 476

On Sun, May 8, 2016 at 10:23 AM, TyanNN [email protected] wrote:

@waterlink https://github.com/waterlink i actually remeber somebody
building crystal under that ubuntu-in-windows thingy, it was crashing due
to the RAM limitation (it's only 1 GB) tho


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
#2569 (comment)

@vaartis
Copy link

vaartis commented May 8, 2016

@waterlink well, it probably does, so yep, just can install it like that. I'll probably ask somebody to test it

@nob-suz
Copy link

nob-suz commented May 8, 2016

I can run and apt-get cryatal now in Bash-windows at win10 Techpreview 14332,as someone reported ever, But only compile sorcecode at terminal-based application,like manderbrot. bash-win have now max 1GB limit,but these may be soon improved https://github.com/Microsoft/BashOnWindows
14228 to 14332 was only 1 week in Microsoft. Bash-win cannot treat windows things, but in bash now emacs,Ruby Python,Rust,Go,JDK is going to act,and someone trying to report x-windows,It may be long to port crystal ,but expect shorter to see Crystal-windows than ever!

@vaartis
Copy link

vaartis commented May 8, 2016

@waterlink seems like it works yes

@asterite
Copy link
Member

asterite commented May 8, 2016

Apart from what @ysbaddaden said, another major difference with POSIX is exception handling. At least that's what @waj told me. I don't know the details because he implemented all of that. The related code is in:

The exception handling involves a personality function. @waj found a lot of info in this blog post because he couldn't find official docs for this, it seems you have to figure it all out by reverse engineering.

That said, if we all focus our efforts on Windows in one release, we should be able to make it. Someone tried to make Windows happen, in parallel, but the language was so in flux that most of his time was spent on fixing merge conflicts. Now things are not only much stable, but all the required C functions are grouped and located on the src/lib_c directory, thanks to @ysbaddaden. Ideally, we should aim to use Windows API, not cygwin: the less dependencies we have, the better (it might only be faster, but I don't know).

Another small issue is that we'll need Continuos Integration (CI) server to test that, once we do get Windows support, it doesn't break between commits and changes.

We should probably have a single tracking issue for Windows support with a list of checkboxes that we need to check/understand before implementing it, together with answers/ideas that we have. For example we could have a list that maps POSIX functions to Windows functions, so when we decide to start porting stuff it'll be much easier to do.

@nob-suz
Copy link

nob-suz commented May 9, 2016

Hi! Another information for Windows.
Microsoft began to support Clang (+LLVM IR) in Visual Studio last April(Preview).
Clang-VisualStudio update released last December(Clang with Microsoft CodeGen),but they announced the incompleteness of exception handling,but it's on following Issue.(may be less problems than Gcc issue?) https://blogs.msdn.microsoft.com/vcblog/2015/12/04/clang-with-microsoft-codegen-in-vs-2015-update-1/
The second update is done this March,but may still remain incompleteness of exception handling and still preview(I don't try yet ).
These smells nearer to reach Crystal-win!

@jhass
Copy link
Member

jhass commented May 11, 2016

Duplicate of #26 ?

@ozra
Copy link
Contributor

ozra commented May 12, 2016

Deffo

@asterite
Copy link
Member

I'm closing this in favor of #26 . Let's keep the discussion in a single place.

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

8 participants