On 13 November 2010 04:22, Jon <par...@gmail.com> wrote:
> I found this project from Hacker New. Very interesting and cool, I've
> never seen a language like it before. I cloned the repo and fired up
> make and then I hit this road block
>
> Building main executable...
> src/types.cpp: In member function ‘TypeStatus::operator uintptr_t()
> const’:
> src/types.cpp:1514: error: cast from ‘Type*’ to ‘unsigned int’ loses
> precision
> make: *** [anic] Error 1
This seems to be an OS X specific problem as it compiles fine on Linux
and Windows. I don't know if Adrian has tried testing it on OS X at
all yet. I haven't anyway.
The problem is this line of code:
TypeStatus::operator uintptr_t() const {return (unsigned int)type;}
type's datatype is Type*, it appears that it won't let you cast a
pointer to an unisnged int. My guess is because OS X is 64bit and
everyone else has only used 32bit systems? Casting a 64bit pointer to
a 32bit unsigned int would indeed "lose precision". Maybe you can tell
your compiler to not treat warnings as errors? Alternatively you could
try casting to a 'unsigned long long' or something like that instead.
>
> my gcc version is i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1
> I poked at the wiki and the list archive but couldn't find any mac
> specific instructions. I poked at the repo and failed to find any mac
> branches/ tags. I reverted a couple of times and tried to recompile.
As far as I know, no effort has yet been made to compile under mac.
>
> I then gave up and switched to debian were the project complies just
> fine and dandy. I wiped up a hello world.
> "Hello, World" ->std.out
> Then I ran ./anic helloworld.txt -o a.out -v
> Which compiles according to the compiler output but when I run a.out I
> don't get any ouput. And so I am a little stuck... Anyways keep up the
> good work I look forward to following this project.
As has been mentioned on the list a number of times already, this is
very much the expected behaviour right now. The compiler is still an
(early) work in progress and code generation is not yet implemented,
so the output file will be empty. I was supposed to implement basic
codegen a few months ago, but other work kinda took over my life for a
while. Since Adrian is really quiet at the moment, I suspect hes in a
similar situation.
I will certainly let the list know when I finally get around to
finishing the codegen stuff I started in the summer, but I can't
commit to any specific "release date" right now. Of course, if someone
else wanted to tackle it... ;-)
> -Jon
>
>
Regards,
Dan.
This is expected. See my previous email.