Matthias247 has quit [Read error: Connection reset by peer]
kulibali has quit [Quit: Going offline, see ya! (www.adiirc.com)]
jemc has joined #ponylang
jemc has quit [Ping timeout: 246 seconds]
amclain has quit [Quit: Leaving]
jemc has joined #ponylang
doublec has quit [Quit: leaving]
c355e3b has quit [Quit: Connection closed for inactivity]
jemc has quit [Ping timeout: 260 seconds]
jemc has joined #ponylang
doublec has joined #ponylang
TwoNotes has joined #ponylang
avsej has quit [Ping timeout: 250 seconds]
avsej has joined #ponylang
avsej has joined #ponylang
TwoNotes has quit [Quit: Leaving.]
jemc has quit [Ping timeout: 245 seconds]
otremblay has quit [Ping timeout: 258 seconds]
otremblay has joined #ponylang
unbalanced has joined #ponylang
omarkj_ has joined #ponylang
SeanTAllen_ has joined #ponylang
omarkj has quit [Ping timeout: 258 seconds]
Fuuzetsu has quit [Ping timeout: 258 seconds]
unbalancedparen has quit [Read error: Connection reset by peer]
srenatus[m] has quit [Ping timeout: 258 seconds]
SeanTAllen has quit [Ping timeout: 258 seconds]
ohir has quit [Ping timeout: 258 seconds]
SeanTAllen_ is now known as SeanTAllen
omarkj_ is now known as omarkj
ohir has joined #ponylang
ohir has joined #ponylang
Fuuzetsu has joined #ponylang
srenatus[m] has joined #ponylang
_andre has joined #ponylang
c355e3b has joined #ponylang
jemc has joined #ponylang
Praetonus has joined #ponylang
TwoNotes has joined #ponylang
<TwoNotes>
Re issue #1445, what is the correct syntax combining cstring, _offset, and _unsafe to do the fix for this?
Perelandric has joined #ponylang
<Perelandric>
jemc: Do string literals not produce a null terminated string?
<TwoNotes>
There was a recent change to the way Strings are stored.
<Praetonus>
Perelandric: String literals are null terminated
<Praetonus>
TwoNotes: cstring()._unsafe()._offset(...) should do the trick
<TwoNotes>
Hmm, that did not help.
<TwoNotes>
I edited the file in /usr/local/lib/pony
<TwoNotes>
I notice that the string "1.00" has a _size of 4 and an _alloc of 5
<Perelandric>
Thanks Praetonus. If the string is terminated, and `cstring()` just returns the `_ptr` in that case, I'm not seeing the difference it would make.
<Praetonus>
There are some strange things happening here
<Perelandric>
I get _size=4 _space=4 is_null_terminated=true. Definitely weird.
<Perelandric>
That is, size() and space() are 4.
<TwoNotes>
Version 0.9.0?
<TwoNotes>
I am running ponyc 0.9.0 on Ubuntu 16.04 on arm7hf
<Perelandric>
I'm using: 0.9.0-e8b6604 [release], built yesterday, LinuxMint 18
<Perelandric>
I should point out that I have LLVM 3.8.0, which I know is a no-no.
<Perelandric>
Oh wait, that's not weird since it subtracts out the null pointer byte.
<Perelandric>
TwoNotes: Are you using the tagged release of 0.9.0, or a master branch build?
<TwoNotes>
I compiled it myself - it says 0.9.0-de0c867
<TwoNotes>
I just did a 'git pull'
<TwoNotes>
It is compiled with LLVM 3.7.1
<TwoNotes>
Looking at the float value as hex, it is 0x00800000
<TwoNotes>
I will checkout "0.9.0" so I get a consistent set of sources and try again
emancu has joined #ponylang
TwoNotes has quit [Quit: Leaving.]
TwoNotes has joined #ponylang
<TwoNotes>
After rebuilding using the tagged 0.9.0, I get the same result.
<jemc>
okay, makes sense - and as a sanity check, is it guaranteed that `sizeof(size_t) == sizeof(char**)` on all platforms - I *think* so, but just wanted to raise the question
<jemc>
pretty sure `size_t` means integer-the-same-size-as-a-pointer, but just wanted to confirm
<TwoNotes>
It is a 32 bit platform
kulibali has joined #ponylang
prose[m] has quit [Remote host closed the connection]
M-Ingo has quit [Remote host closed the connection]
M-hrjet has quit [Remote host closed the connection]
srenatus[m] has quit [Read error: Connection reset by peer]
irx[m] has quit [Remote host closed the connection]
buchanon[m] has quit [Write error: Connection reset by peer]
<jemc>
TwoNotes: can you try printing `USize.bitwidth()` on your ARM platform?
<jemc>
(and tell us what is being used)
<jemc>
I just want to confirm that we are getting the size of `USize` right for your platform.
<TwoNotes>
32
<TwoNotes>
uname identifies it as an arm7l
<TwoNotes>
32 is correct. Ubuntu runs the Rpi3 in 32bit mode
<TwoNotes>
All this works correctly on x86_64 by the way. It is something specific to ARM, or the ubuntu libraries there
<TwoNotes>
The is a difference in the behavior of @strtof. And several months ago before I rebuilt the system, this same code worked
<jemc>
TwoNotes: if you write a small C program that calls strtof, does it work correctly?
<jemc>
if it's also broken from C, then the solution is simply to remove the strtof dependency and implement the functions in pure pony, which I've already captured as a goal here: https://github.com/ponylang/ponyc/issues/1449
<jemc>
however, it would be good to know if this is a more insidious problem with our FFI
<TwoNotes>
It works correctly in C
<TwoNotes>
I took the sample code from that Debian page, and put "1.00" in as the string
<TwoNotes>
So maybe the problem in is in the FFI mechanism. Are there platform ifdefs in there?
<TwoNotes>
The C code gets identical rusults on the two platforms. The Pony code does not
<Praetonus>
TwoNotes: Can you get the assembly code for both String.f32 and your C program that calls strtof?
<Praetonus>
And the LLVM IR if you're using Clang
<Praetonus>
You might need to compile the Pony program with --extfun if you're doing an optimised build