Skip to content
This repository has been archived by the owner on Oct 18, 2020. It is now read-only.

Missing strtod #118

Closed
samoht opened this issue Jan 29, 2015 · 11 comments
Closed

Missing strtod #118

samoht opened this issue Jan 29, 2015 · 11 comments
Labels

Comments

@samoht
Copy link
Member

samoht commented Jan 29, 2015

val float_of_string (and the corresponding Scanf function) uses strod (see the relevant OCaml code). However It seems that we do not support it.

@samoht samoht added the bug label Jan 29, 2015
samoht referenced this issue Jan 29, 2015
Just enough to let us compile and run the OCaml runtime. Writing to
stdout or stderr outputs the string with printk, which is useful
for debugging.
@MagnusS
Copy link
Member

MagnusS commented Jun 2, 2015

This currently also means that calls to float_of_string will compile, but crash the unikernel at runtime.

@dbuenzli
Copy link

dbuenzli commented Jun 2, 2015

FWIW the algorithms of this paper look interesting. A self-contained BSD3 implementation by the author is available here.

@talex5
Copy link
Contributor

talex5 commented Jun 5, 2015

Interesting. A small self-contained implementation of this would be very welcome. Are there any issues with using C++ code in mirage-xen? I guess it will need some support libraries.

@hhugo
Copy link

hhugo commented Jun 8, 2015

related : http://caml.inria.fr/mantis/view.php?id=6701
(strtod is locale dependent)

@yomimono
Copy link
Contributor

This came up again from a user via cohttp: https://github.com/mirage/ocaml-cohttp/blob/master/lib/accept_parser.mly#L45 .

@timbertson
Copy link
Contributor

I've also hit this with yojson, parsing any JSON data containing a float.

@dbuenzli
Copy link

dbuenzli commented Apr 8, 2016

New issue with a reference to a new paper http://caml.inria.fr/mantis/view.php?id=7218

@dbuenzli
Copy link

As follow up to the call. The code I'm using in libc-ocaml is this one. It is what used to be used e.g. in V8 before they switched to grisu, here's the removal commit.

@dbuenzli
Copy link

Note also that there is a change log here it may be a good idea to mention which version was picked up.

@ansiwen
Copy link

ansiwen commented Apr 29, 2016

same problem here in cohttp in combiation with webmachine: https://bpaste.net/show/607e55d45508

so, will this be fixed? what can we do about it? I need a solution, but I'm not sure how it's going to be fixed. I could help.

@talex5
Copy link
Contributor

talex5 commented Apr 30, 2016

@ansiwen Thanks for the offer! Someone needs to pick a suitable-licensed, self-contained, not-too-messy C implementation and copy it into mirage-platform here: https://github.com/mirage/mirage-platform/tree/master/xen-posix/src (next to fmt_fp.c, which does the other direction).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants