6 ms·
>Are you suggesting Haskell can generate object files, shared objects, and binaries for my systems without compiling to C or C++ first? Of course, that's what
by MustardTiger 10y ago
>Are you suggesting Haskell can generate object files, shared objects, and binaries for my systems without compiling to C or C++ first?
Of course, that's what ghc does by default.
>How would it get the file formats and calling conventions right?
The same way every other compiler does. What systems are we talking about?
- jjnoakes 10y ago> Of course, that's what ghc does by default. ghc by default can generate object files for systems it doesn't know about? That sounds positively magical. How does it work? > The same way every other compiler does. Every other compiler that targets native code for these systems has first-hand knowledge of the file formats. If Haskell doesn't require that knowledge, I would love to hear about how it works. Here's an example. Say Haskell only supported Windows on x86_64 and I'd like to build my Haskell program for Linux on PowerPC. Are you telling me Haskell on Windows could generate Linux on PowerPC executables and shared libraries without first-hand knowledge of the instruction set, calling conventions, and the ELF file format?
- MustardTiger 10y agoI don't know why you are being so hostile and evasive at the same time. What systems are you talking about. I will tell you if there is a compiler that supports them. That's the problem right? That it will turn out that your obscure systems are very normal and supported. Silly fallacious replies about magic are not constructive. Just answer the question and I can help you.
- jjnoakes 10y agoI'm not being hostile at all. If such a thing exists as I believe you described it, I would find it to be magical and would love to use it. I would even pay for it. And I'm not being particularly evasive either. I gave you an example which fits my situation perfectly. I'd prefer not to reveal the names of the actual systems I need to build for, since it would fairly uniquely identify me. Are you willing to work with the hypothetical I put forward? Or are you dodging that in favor of attacks on me personally?
- MustardTiger 10y agoEvery native compiler does this. There is nothing magical about it. Obviously the platform has to be supported. That's why i asked what the platform is. The idea that you are the only person running a system is absurd. Even the most obscure platforms have thousands of active users. Your hypothetical can not be worked with, because it is a concrete question. Is your platform supported or not. Very simple. And again, if you want to have it generate C, then do so.
- jjnoakes 10y agoYou think I haven't tried using Haskell on my platform? It isn't supported and it doesn't work. So you misrepresented things. I mean why would my first post be "Boy I wish I could use Haskell on my platform" if... I could use Haskell on my platform? Now I could put a ton of effort into it... for each platform... but I don't have that kind of time to maintain Haskell for N platforms. It would be much easier to compile via portable C or C++ that was human readable. But I would expect, since Haskell has lazy evaluation and a GC, that there is almost no way to map to readable C or C++. Thunks flying around, continuations, ...
- MustardTiger 10y ago>You think I haven't tried using Haskell on my platform? Correct. >It isn't supported and it doesn't work What is "it"? >I mean why would my first post be "Boy I wish I could use Haskell on my platform" if... I could use Haskell on my platform? Because you incorrectly believe you can't. >It would be much easier to compile via portable C or C++ that was human readable Then do that, like I told you repeatedly. The fact that you have one of the developers of a haskell compiler trying to help you and you are entirely hostile and evasive makes it hard to take you seriously.
- jjnoakes 10y ago> Correct. Why would you think that when I've said exactly the opposite? Who is being hostile and evasive here? > What is "it"? Also already mentioned above (file formats, instruction sets, calling conventions). > Because you incorrectly believe you can't. I wish that was true. > Then do that, like I told you repeatedly. If you show me how to generate portable C or C++ that's human readable from Haskell, I'd be happy to. You keep claiming Haskell solves my problems, except every time we look closely at your recommendations, they are full of holes. And I'm hostile and evasive.