flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
donn 25 Oct 2018, 00:50
Is the assembly complete? What happens at
Code: base_GHCziNum_zp_info I just got ghc installed on this computer and haven't yet built a working example. It looks like the params are the second member into Code: s19G_closure: and Code: s19F_closure: It may be a bit easier reading in Intel syntax: https://stackoverflow.com/questions/15529785/how-to-generate-intel-assembler-syntax-from-ghc-of-haskell Was just curious about this topic, but will take a deeper look tomorrow if there's time. Good luck |
|||
![]() |
|
Mino 25 Oct 2018, 19:49
I must admit that I don't really understand this code.
Here is a link from which you can test: https://godbolt.org/z/dXi__D Thank you for link ![]() _________________ The best way to predict the future is to invent it. |
|||
![]() |
|
donn 04 Nov 2018, 14:31
Apparently, you're not alone:
https://news.ycombinator.com/item?id=13182726 Quote:
My computer has some disk problems and won't start this week. My tablet doesn't yet have Linux either. But once it works again, I might try jhc. Last time I tried running that Haskell through ghc it wouldn't compile, so I'll have to find a working example. It was getting hung up on something trivial if I remember correctly, so may have just been a typo on my part. |
|||
![]() |
|
bitRAKE 04 Nov 2018, 16:13
I imagine the actual addition is done by "base_GHCziNum_zp_info" or rather after it. It's a data driven approach with multiple stacks. The compiler probably splits data and execution streams to provide better error reporting and recovery, as well as automatic garbage collection. Possibly multiple data streams.
|
|||
![]() |
|
Mino 04 Nov 2018, 17:20
@bitRAKE: It's possible, yes. But I don't know any more than you do ^^
@donn: I fully agree with these quotes. The code generated by GHC (I have never tried JHC) is really unreadable. It's a spaghetti code. If this is for a simple addition, imagine the code generated for a program that is a little more complex... In my opinion, it's due to the lazy evaluation, but personally I think it's Haskell's devs who are lazy at the idea of generating a readable code ![]() _________________ The best way to predict the future is to invent it. |
|||
![]() |
|
revolution 04 Nov 2018, 18:24
The AT&T syntax isn't helping either. But I don't see any lazy evaluation here. Just normal code to check the stack, retrieve the values and then ... jmp somewhere to do the addition. Since the addition code isn't shown then we don't really know what it is doing.
|
|||
![]() |
|
Mino 04 Nov 2018, 21:06
Haskell is defined as performing lazily, however. I think, it just has to be an abstraction for this case....
|
|||
![]() |
|
revolution 04 Nov 2018, 21:19
My understanding of lazy evaluation is that if an earlier test condition is false then the remainder of the tests can be skipped. But the code there doesn't have any tests, the addition is always needed to be done when the function is executed.
I agree that the generated code is ugly, but I think that is a different matter not related to any evaluation methodology. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.