kakadu has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
Stalkr_ has joined #ocaml
struk|desk|away is now known as struk|desk
Simn has quit [Read error: Connection reset by peer]
idegen has joined #ocaml
idegen has quit [Client Quit]
<please_help>
is it possible to modify a running ocaml executable image at runtime like it is in lisps?
struk|desk is now known as struk|desk|away
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
hunteriam has joined #ocaml
esad has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
<aantron>
please_help: closest i've heard to this is MetaOCaml
nicoo has quit [Ping timeout: 260 seconds]
<please_help>
aantron: metaocaml seems to add stages so that some code's compilation can be deferred until runtime, but it does not appear to enable runtime modification of an already-running image.
<aantron>
right
<def`>
please_help: like what the toplevel is doing?
<def`>
"dynamic linking" is provided by the Dynlink module
<please_help>
def`: it's not dynamic linking. Suppose you have a function f which invokes another function g. Your program has been running for 5 days and then a bug is found: g passes the wrong arguments to f. Modifying the running image involves, in one way or another, replacing the malfunctioning code by a fixed version of the code. In lisps, it is possible to redefine functions during runtime. The image will be patched with the
<please_help>
compiled version of the new code.
<please_help>
s/f/g
nicoo has joined #ocaml
<def`>
you can extend in a way that respects the hyper static environment
<def`>
(following terminology from Queinnec book "Lisp In Small Pieces", since you seem to be a lisper :))
Stalkr_ has quit [Ping timeout: 255 seconds]
<def`>
If you want to do that in OCaml, you can manually transform functions you want to update into references
<def`>
This should allow typesafe updating with dynlinking
<pierpa>
if one wants to fix programs without restarting should look at Erlang, not Lisps
<def`>
If you don't need typechecker approval, it is possible to monkey patch definition in bytecode runtime :p. It will fail in native mode because of inlining
demond has joined #ocaml
demond has left #ocaml ["+++"]
<please_help>
def`: having to manually pre-specify what we might want to update just means we'll end up making any use of a function actually a use to a function contained in a ref cell instead since we don't know in advance where bugs will be (it might also not be bugs; another use case is in quick iterative development in the presence of very long or costly initialization).
<def`>
please_help: I agree it is not convenient. There is no language support for that feature
<def`>
All I said were basically hacks to say "not impossible"
<def`>
From a statuc point of view, I am not aware of any study of such features in a typed language.
<def`>
From a dynamic one, either you have to prevent a lot of optimizations, or rely on dynamic code generation (most lisps)
<def`>
(oh there is JRebel for java... I have no experience with it though, the semantics looked unclear when I checked)
<please_help>
I think (but I'm not entirely positive) that chicken supports this. It's a scheme implementation that compiles to C and it supports static typing. Eitherway, it's too bad ocaml doesn't have something like that. Performance of the code being patched in typically doesn't need to matter all that much, as opposed to the ability to quickly change the running program at runtime without interruption of service.
cody` has quit [Quit: Connection closed for inactivity]
<please_help>
of course, the performance of the rest of the program should remain unchanged as much as possible, otherwise you might as well just restart anyway.
huza has joined #ocaml
<Drup>
that's one thing to say it, that's another to do it. After several decades of work on various compilers, lisp/scheme performances are still not really fabulous and their static typing discipline are quite specific to accommodate for those features (when they have some).
huza has quit [Quit: WeeChat 0.3.8]
Mirry has joined #ocaml
govg has joined #ocaml
<cojy>
please_help: in chicken the new version will just be interpreted
<cojy>
you could dynlink stuff as well though
lopex has quit [Quit: Connection closed for inactivity]
<please_help>
I know in some lisp the new version is compiled (typically to bytecode though). But the new version being interpreted is often better than having to redeploy, and for quick development as mentioned, it's more than good enough. How would I use dynlink to achieve a similar effect though?
aantron_ has joined #ocaml
aantron has quit [Ping timeout: 256 seconds]
hunteriam has quit [Quit: Connection closed for inactivity]
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
cyraxjoe has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
cyraxjoe_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
struk|desk|away is now known as struk|desk
esad has quit [Ping timeout: 276 seconds]
yon0 has joined #ocaml
yon0 has left #ocaml ["+++"]
esad has joined #ocaml
govg has joined #ocaml
mac10688 has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
darkf has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
struk|desk is now known as struk|desk|away
Sorella has quit [Quit: Connection closed for inactivity]
f[x] has joined #ocaml
Mirry has quit [Ping timeout: 240 seconds]
ygrek_ has quit [Ping timeout: 245 seconds]
Mirry has joined #ocaml
xyh has joined #ocaml
f[x] has quit [Ping timeout: 255 seconds]
<xyh>
there is not 'uninstall' function in the makefile ?
cody` has quit [Quit: Connection closed for inactivity]
struk|desk is now known as struk|desk|away
xyh is now known as good-game
sbrouf has quit [Ping timeout: 245 seconds]
Mirry has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 276 seconds]
Sorella has joined #ocaml
sh0t has joined #ocaml
good-game is now known as xyh
FreeBirdLjj has joined #ocaml
d0nn1e has quit [Ping timeout: 255 seconds]
d0nn1e has joined #ocaml
xyh is now known as xieyuheng
lokien_ has quit [Quit: Connection closed for inactivity]
HelloWorld has joined #ocaml
HelloWorld is now known as Guest382
Mirry has joined #ocaml
<Guest382>
Hi everyone. Could someone tell me what does the '##' represent in, for example, Firebug.console##log (Js.string 'hello') (Js_of_ocaml library) ?
octachron has joined #ocaml
<companion_cube>
it's the syntax for calling JS methods in js_of_ocaml
<companion_cube>
the single '#' is regular OCaml method call
<Guest382>
It's not a part of ocaml "standard" syntax ?
<companion_cube>
I don't think so
<companion_cube>
js_of_ocaml provides this as part of a syntax extension, afaik
<octachron>
No, operators with double # are disabled in vanilla ocaml
<companion_cube>
I think there is (was?) a PR to make '##' a regular infix operator
Mirry has quit [Ping timeout: 245 seconds]
<octachron>
companion_cube, it is more subtle than that: user-defined operators starting with # are possible since ocaml ≥ 4.02.3
<companion_cube>
oh ok
<octachron>
however, they can not contain more than one #
<companion_cube>
but ## isn't allowed :(
<companion_cube>
I jsut tried
<octachron>
otherwise, they are rejected during typing
<octachron>
but not during parsing
<octachron>
so ppx rewriter can use them, but not vanilla ocaml
<companion_cube>
oh.
<companion_cube>
pretty weird.
<Guest382>
Thanks for your answer.
Guest382 has quit [Quit: Leaving]
xieyuheng is now known as xyh
<octachron>
This behavior is quite ... subtle, I agree. Fortunately, it should be documented in the manual for 4.03
<companion_cube>
:D
dwillems has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
sh0t has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
dwillems has quit [Ping timeout: 250 seconds]
hannes has quit [Ping timeout: 255 seconds]
mac10688 has joined #ocaml
JacobEdelman has joined #ocaml
govg has quit [Ping timeout: 250 seconds]
lokien_ has joined #ocaml
mort___ has joined #ocaml
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
octachron has quit [Quit: Leaving]
hannes has joined #ocaml
Guest90833 has quit [Quit: Guest90833]
aantron has joined #ocaml
badon has quit [Disconnected by services]
badon_ has joined #ocaml
badon_ is now known as badon
govg has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
Mirry has joined #ocaml
gpietro_ has joined #ocaml
Mirry has quit [Ping timeout: 272 seconds]
BitPuffin|osx has quit [Ping timeout: 256 seconds]
sh0t has quit [Ping timeout: 245 seconds]
<please_help>
is there an ETA for 4.03?
<adrien>
"soon"
<companion_cube>
there's still some heavy merging going on
<companion_cube>
oh, ephemerons are still scheduled for 4.03?
<Drup>
Apparently
Mirry has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
struk|desk|away is now known as struk|desk
gpietro__ has joined #ocaml
gpietro_ has quit [Read error: Connection reset by peer]
sh0t has joined #ocaml
Mirry has quit [Ping timeout: 276 seconds]
Stalkr_ has quit [Quit: Leaving...]
Mirry has joined #ocaml
gpietro__ has quit [Ping timeout: 276 seconds]
<please_help>
flambda, multicore, ephemerons, what else?
<Drup>
not multicore, no
mcmillhj has joined #ocaml
Mirry has quit [Ping timeout: 260 seconds]
<ggole>
Ephemerons?
Mirry has joined #ocaml
octachron has joined #ocaml
mort___ has left #ocaml [#ocaml]
gpietro_ has joined #ocaml
Mirry has quit [Ping timeout: 240 seconds]
<ggole>
Oh, I see
xyh has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.39/20151206235742]]
sh0t has quit [Ping timeout: 265 seconds]
gpietro__ has joined #ocaml
lokien_ has quit [Quit: Connection closed for inactivity]
mort___ has joined #ocaml
xyh has joined #ocaml
gpietro_ has quit [Ping timeout: 264 seconds]
Stalkr_ has joined #ocaml
struk|desk is now known as struk|desk|away
struk|desk|away is now known as struk|desk
zpe has joined #ocaml
hunteriam has joined #ocaml
<please_help>
No multicore for 4.03? Has it been pushed back then?
<companion_cube>
it's not ready, so it's not been even proposed for merging yet
<Drup>
to paraphrase one of the multicore dev "Only one change that can make your code segfault per release" :p
esad has joined #ocaml
<companion_cube>
I suppose flambda qualified
<companion_cube>
qualifies*
<Drup>
companion_cube: precisely ^^
psy_ has quit [Remote host closed the connection]
Mirry has joined #ocaml
sbrouf has joined #ocaml
struk|desk is now known as struk|desk|away
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
esad has joined #ocaml
lokien_ has joined #ocaml
<Simn>
Is there any way to make Arg.parse print its help to stdout instead of stderr?
<companion_cube>
you can catch the exception it throws
<companion_cube>
if you use Arg.parse_argv
<Simn>
Thanks
* jerith
writes some OCaml code for the first time in far too long.
struk|desk|away is now known as struk|desk
dwillems has joined #ocaml
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Kristien has joined #ocaml
octachron has quit [Quit: Leaving]
Kristien is now known as ely-se
esad has joined #ocaml
zpe has quit [Remote host closed the connection]
tmtwd has joined #ocaml
struk|desk is now known as struk|desk|away
groovy2shoes has quit [Quit: Leaving]
Snark has quit [Remote host closed the connection]
yawnt has quit [Changing host]
yawnt has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Mirry has quit [Ping timeout: 250 seconds]
kushal has quit [Quit: Leaving]
slash^ is now known as Lionel_Hutz
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Lionel_Hutz is now known as Miguel_Sanchez
govg has quit [Ping timeout: 272 seconds]
Snark has joined #ocaml
Haudegen has joined #ocaml
Mirry has joined #ocaml
zpe has joined #ocaml
ggole has quit []
Mirry has quit [Ping timeout: 245 seconds]
xyh has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.39/20151206235742]]
esad has joined #ocaml
Miguel_Sanchez has quit [Read error: Connection reset by peer]
ely-se has quit []
ely-se has joined #ocaml
mort___ has left #ocaml [#ocaml]
Mirry has joined #ocaml
gdrooid has joined #ocaml
f[x] has joined #ocaml
Mirry has quit [Ping timeout: 260 seconds]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
sillyotter has joined #ocaml
mort___1 has joined #ocaml
ewanas has joined #ocaml
Mirry has joined #ocaml
zpe has quit [Remote host closed the connection]
Mirry has quit [Ping timeout: 240 seconds]
sillyotter has quit [Quit: leaving]
mort___1 has quit [Quit: Leaving.]
zpe has joined #ocaml
esad has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Simn has quit [Quit: Leaving]
hunteriam has quit [Quit: Connection closed for inactivity]
esad has joined #ocaml
tumdum has quit [Ping timeout: 246 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
esad has quit [Client Quit]
tumdum has joined #ocaml
tumdum has quit [Changing host]
tumdum has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Mirry has joined #ocaml
Mirry has quit [Client Quit]
Stalkr_ has quit [Quit: Leaving...]
gpietro__ has quit [*.net *.split]
troydm has quit [*.net *.split]
emias has quit [*.net *.split]
ia0 has quit [*.net *.split]
vpm has quit [*.net *.split]
Muzer has quit [*.net *.split]
dmiller has quit [*.net *.split]
riveter has quit [*.net *.split]
darkf has quit [Quit: Leaving]
vpm has joined #ocaml
<gdrooid>
Hi all! I'm playing Codingame to practice OCaml. I've gone successfully thourgh all the easy games, but as the medium difficulty ones require more code, it's getting ugly even if it works. Could someone take a look at the code I've written for the puzzle I'm currently solving to help me find better ways of writing it?
<gdrooid>
So far I'm reading the input, and it got ugly already...
<Drup>
hum, what's your goal with this huge function exactly ?
<Drup>
what's the data structure you want at the end ?
<gdrooid>
it's a list of nodes of type int * int list * bool, where the int is the index of the node (to identify it), and the list contains the index of the nodes linked to it
lokien_ has joined #ocaml
<Drup>
right
<gdrooid>
the links are two-way
<Drup>
so you should probably start by create some auxiliary function to build graphs
<Drup>
like "add_node" and "add_edge"
<Drup>
creating*
dwillems has quit [Ping timeout: 272 seconds]
<gdrooid>
:) ok
<Drup>
I guess you already wrote them, somewhere in the middle of the big blob of code, but you should isolate them as separated functions
<Drup>
(and "mark_exit", too, probably)
zpe has quit [Remote host closed the connection]
<Drup>
don't hesitate to define a type "node" using records
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
<gdrooid>
I guess I should avoid using the node type in its own definition, right? It's tempting to use a node list, instead of a int list...
<Drup>
It's not a great idea in this case, yeah
<Drup>
(it makes building cycle very annoying)
sbrouf has quit [Quit: Quitte]
dmiller has joined #ocaml
riveter has joined #ocaml
ia0 has joined #ocaml
Muzer has joined #ocaml
dwillems has joined #ocaml
Guest3960 has quit [Quit: leaving]
ely-se has quit [Quit: Leaving...]
ivan\ has quit [*.net *.split]
ivan\ has joined #ocaml
ivan\ has quit [Max SendQ exceeded]
ivan\ has joined #ocaml
Stalkr_ has joined #ocaml
aantron has quit [Remote host closed the connection]
martintrojer has quit [Ping timeout: 250 seconds]
Pepe__ has joined #ocaml
stux|RC has quit [Ping timeout: 250 seconds]
gustav___ has quit [Ping timeout: 250 seconds]
stomp has quit [Ping timeout: 250 seconds]
Pepe_ has quit [Ping timeout: 240 seconds]
gustav___ has joined #ocaml
martintrojer has joined #ocaml
stomp has joined #ocaml
aantron has joined #ocaml
tg has quit [Ping timeout: 250 seconds]
S11001001 has quit [*.net *.split]
rfv has quit [*.net *.split]
NhanH has quit [*.net *.split]
jeroud has quit [*.net *.split]
dch has quit [*.net *.split]
emmanueloga has quit [*.net *.split]
djellemah has quit [*.net *.split]
Enjolras has quit [*.net *.split]
dexterph has quit [*.net *.split]
cschneid has quit [*.net *.split]
flux has quit [*.net *.split]
struk|desk has joined #ocaml
rfv has joined #ocaml
struk|desk|away has quit [Ping timeout: 250 seconds]
djellemah has joined #ocaml
S11001001 has joined #ocaml
NhanH has joined #ocaml
jeroud has joined #ocaml
dch has joined #ocaml
emmanueloga has joined #ocaml
cschneid has joined #ocaml
flux has joined #ocaml
dexterph has joined #ocaml
Enjolras has joined #ocaml
stux|RC-only has joined #ocaml
tg has joined #ocaml
<gdrooid>
Thank you very much Drup, it's looking better now :)