<zRecursive>
Can i suppress the "- : int = 0" after running `ocaml str.cma unix.cma -noprompt -init $MD/ocaml/myUtils.ml foo()` ?
connorjacobsen has quit [Read error: Connection reset by peer]
connorjacobsen has joined #ocaml
yegods has quit [Remote host closed the connection]
sh0t has joined #ocaml
two_wheels has joined #ocaml
rgrinberg has joined #ocaml
Koromori has joined #ocaml
connorjacobsen has quit [Remote host closed the connection]
yegods has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
Koromori has left #ocaml [#ocaml]
yegods has quit [Ping timeout: 252 seconds]
apache2_ has quit [Remote host closed the connection]
apache2 has joined #ocaml
connorjacobsen has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
connorjacobsen has quit [Ping timeout: 250 seconds]
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
copy` has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
FreeBird_ has quit [Ping timeout: 260 seconds]
yegods has joined #ocaml
yegods has quit [Remote host closed the connection]
FreeBirdLjj has quit [Read error: Connection reset by peer]
scarygelatin has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
xcaptain has joined #ocaml
FreeBirdLjj has joined #ocaml
momsthewurd has joined #ocaml
momsthewurd has quit [Ping timeout: 252 seconds]
wiredsister has quit [Ping timeout: 250 seconds]
r_rios has joined #ocaml
p_nathan has joined #ocaml
tmtwd has quit [Ping timeout: 246 seconds]
sh0t has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
tmtwd has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
unbalancedparen has quit [Quit: WeeChat 1.5]
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
jonasen has joined #ocaml
yegods has joined #ocaml
yegods has quit [Ping timeout: 258 seconds]
r_rios has quit [Quit: Konversation terminated!]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
groovy2shoes has joined #ocaml
rgrinberg has quit [Ping timeout: 276 seconds]
jonasen has joined #ocaml
FreeBird_ has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
atbagautdinov has joined #ocaml
A1977494 has joined #ocaml
<flux>
zrecursive, hmm, do you need to use that -init switch at all?
<flux>
but I cannot reproduce regardless
<flux>
not sure what the last argument is, my ocaml won't accept one
<flux>
without -init it takes the last ml as the code and then foo() becomes an argument to that
two_wheels has quit [Read error: Connection reset by peer]
FreeBird_ has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<zRecursive>
flux: In fact, i use "echo "$* ;;" | ocaml str.cma unix.cma -noprompt -init $MD/ocaml/myUtils.ml" in ~/bin/ml, then i can call functions in myUtils.ml from shell. So far so good, except each call will print its type signature.
zRecursi` has joined #ocaml
uriznik has joined #ocaml
zRecursive has quit [Ping timeout: 240 seconds]
<flux>
I think there is some programmatic way you might be able to use to evaluate top-level-phrases without that output..
<flux>
zrecursi`, how about this, you away-nicker: ocaml <(cat foo.ml; echo 'foo()')
<zRecursi`>
flux: `ocaml <(cat $MD/ocaml/foo.ml; echo 'his()')` => Eshell does not support input redirection! i am on Windows.
tmtwd has quit [Ping timeout: 250 seconds]
Simn has joined #ocaml
<flux>
well get a decent shell.. :)
<flux>
but I think the original problem may be possible to solve with the Toplevel (?) module.
<flux>
or you could make a proper shell script
<flux>
that writes myUtils.ml and input to a temporary file and loads that with ocaml and removes the temporary file
<zRecursi`>
so complicated ?
<flux>
I'm afraid so. I don't this usecase has been really considered.
<flux>
perhaps you can suggest a new command line switch for disabling the responses :)
<zRecursi`>
In fact, even if in Toplevel, it is still not necesssary to echo the type of each called function.
kolko has joined #ocaml
<zRecursi`>
unless :t foo as haskell does
<flux>
not necessary, but can be nice
<zRecursi`>
sometimes nice, sometimes boring
<flux>
but really almost the only case where it is counter productive is yours.. :)
<zRecursi`>
then haskeller should adopt such a "normal" style ?
<zRecursi`>
If a programmer already knows its signature, why do we waste CPU cycle to print it after each calling ?
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
pierpa has quit [Ping timeout: 250 seconds]
yegods has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
tmtwd has joined #ocaml
FreeBirdLjj has joined #ocaml
<def`>
but it is not printing the type of called functions
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
aggelos_ has joined #ocaml
tmtwd has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Read error: Connection reset by peer]
yomimono has joined #ocaml
FreeBirdLjj has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
darkf has quit [Quit: Leaving]
yegods has quit []
connorjacobsen has joined #ocaml
<flux>
zrecursi`, when using interactive toplevel I reaaaally doubt we should be worried about each CPU cycle :)
<flux>
the user is going to be the bottle neck.
<companion_cube>
depends, if you start a big computation it can take 10 minutes on bytecode and 1 minute on native
<companion_cube>
that makes a difference :D
<companion_cube>
but if it's just printing a signature...
<flux>
so after that 10 minutes 100 microseconds is not much :)
mbrock has joined #ocaml
connorjacobsen has quit [Ping timeout: 250 seconds]
tinamanea_ has joined #ocaml
igitoor has quit [Ping timeout: 260 seconds]
jwatzman|work has joined #ocaml
igitoor has joined #ocaml
tane has joined #ocaml
octachron has joined #ocaml
zRecursi` has quit [Remote host closed the connection]
<tinamanea_>
Hi! I'm working on this code http://pastebin.com/59Q68Xn0 and bumped into an issue with types. I have a module type and a module base that I use to compose more complex modules. The problem is with a type I've declared in the base, as a string. When calling a module function taking a string as argument, the compiler is unable to infer that the type hidden away in the module is a string and complains. Any idea why this might be ha
<def`>
Session_base doesn't expose that a = string
<def`>
remove the coercion on Protocol_base
<tinamanea_>
ok, but should't that info be copied over from Protocol_base when making the new module?
igitoor has quit [Changing host]
igitoor has joined #ocaml
<def`>
what ?
<def`>
the ": Session_base" makes the type of Protocol_base indistinguishable from Session_base
<def`>
equalities "t = protocol_base_formula" and "a = string" are lost
<tinamanea_>
oh, okay. and how could I keep session_base generic and instantiate those types as requested by the module?
<tinamanea_>
I have another module where a is something different
<def`>
Session_base with type t = protocol_base_formula and type a = string
<def`>
But you can also not coerce Protocol_base, you don't need to
manizzle has quit [Ping timeout: 244 seconds]
steve_gh has quit [Ping timeout: 250 seconds]
manizzle has joined #ocaml
<tinamanea_>
if I understand correctly, Protocol_base should be: module Protocol_base : Session_base with type t = protocol_base_formula and type a = string ?
<def`>
it could be yes
<tinamanea_>
instead of assigning concrete types in the body
<def`>
you should assign concrete types in the body
<def`>
but if you want to coerce (what I don't get is why you want to coerce)
<def`>
then you should put the information you want to keep in the coercion
ygrek has joined #ocaml
<tinamanea_>
I need those types because I have another module where a is completely different, if that's what you're asking
<tinamanea_>
having the types both is signature and body of protocol_base seems to work
<tinamanea_>
I am still not sure why :)
<def`>
I think you should remove : Session_base
<def`>
and you will see that it works without problem
<def`>
seems you are misunderstanding some things about the module system
<tinamanea_>
most definitely
kolko has quit [Ping timeout: 260 seconds]
<def`>
the only purpose of : ... is forgetting information
<tinamanea_>
I tried understanding how this works but apparently not enough
<def`>
except in your case you don't want to forget, so you have to reintroduce the information... seems a bit wasteful :)
<tinamanea_>
so in Make_session it wouldn't be neccessary to specify Session_base?
<def`>
rather that's the only place where it is useful
<def`>
because Session_base is exactly what you need in this functor.
<def`>
however in Protocol_base, you don't want just Session_base, you want a little more (Session_base with some equalities)
<octachron>
tinamanea_, another point of view is that in a functor definition, you generally want the signature of the argument to be as large (i.e. as imprecise) as possible
<octachron>
like this you can apply the functor to as many input module as possible
<octachron>
whereas in module definition, you want to keep all useful information, and so have the signature as precise as possible. Moreover, the compiler infers the most precise signature for you
<octachron>
so you often don't need explicit coercion when defining modules
rand__ has joined #ocaml
larhat has joined #ocaml
jonasen has quit [Ping timeout: 250 seconds]
larhat has quit [Ping timeout: 252 seconds]
AlexRussia has quit [Ping timeout: 252 seconds]
larhat has joined #ocaml
vdyjrcclz has joined #ocaml
orbifx has joined #ocaml
vdyjrcclz has quit [Quit: Using Circe, the loveliest of all IRC clients]
Munksgaard has joined #ocaml
<tinamanea_>
okay, will look further into it. def` octachron thanks! :)
<Munksgaard>
After installing the llvm module with `opam install llvm.3.5`, I'm still getting "Error: Unbound module Llvm" when I'm trying to run my project. Does anyone know what's wrong?
<zozozo>
Munksgaard: what do you use to build your project ?
tinamanea_ has quit [Quit: Page closed]
<Munksgaard>
zozozo: `ocamlbuild toy.byte` (I'm trying to follow the llvm ocaml tutorial)
yomimono has joined #ocaml
<Munksgaard>
zozozo: I made it compile by adding `-use-ocamlfind -package llvm`, but I really thought the myocamlbuild.ml file was for that?
tane has quit [Quit: Verlassend]
<Munksgaard>
Also, now I'm getting a "Fatal error: cannot load shared library dllllvm" when I try to run the newly compiled binary
<orbifx>
Munksgaard: the unbound module probably means you have not instructed the compiler to get that from where it is.
<orbifx>
your build toolchain will have ways to specify this
<orbifx>
that shared library loading makes me think it has to do something with your paths.
<zozozo>
Munksgaard: you can use either the myocamlbuild.ml or the _tags file to add dependencies for your build
<Munksgaard>
orbifx: Yes, I got it running by adding a LD_LIBRARY_PATH manually. Which I think it's kind of strange since it's not a dynamic executable. Perhaps it's because it is bytecode or something?
<orbifx>
what does the path point to?
<orbifx>
what path did you have to add to it?
<Munksgaard>
I guess I was under the impression that "eval `opam config env`" too care of this sort of stuff.
<Munksgaard>
zozozo: I just copied them from here: llvm.org/docs/tutorial/OCamlLangImpl3.html#full-code-listing
<Munksgaard>
orbifx: Do you think I should submit a bug report somewhere?
tautologico has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<orbifx>
Munksgaard: first, you should determine it is a bug ideally
jonasen has joined #ocaml
<orbifx>
Until then, maybe post a question somewhere
<Munksgaard>
orbifx: Like where? SO?
dexterph has joined #ocaml
<orbifx>
there, or ocaml mailing list
<orbifx>
or if the project has a github issue system or something.
<orbifx>
most likely someone knows in IRC, but they might be asleep at this time of day :P
<Munksgaard>
Sure :)
<Munksgaard>
zozozo: Are those _tags and myocamlbuild.ml files out of date or something? It's like ocamlbuild doesn't pick up my myocamlbuild.ml file at all
<zozozo>
don't know, i think it's more of a problem of the contents of the files
<Munksgaard>
zozozo: This is what my directory and those two files look like at the moment: http://pastebin.com/9EEx6PAN
<orbifx>
Munksgaard: have you read much about this or learning by trial and error?
<Munksgaard>
orbifx: I must admit, I'm mostly learning by trial and error. Perhaps I need to sit down and spend some more time understanding the build environment...
<zozozo>
well I think a "true: package(llvm)" in the _tags file probably wouldn't hurt, :p
<orbifx>
Munksgaard: yeah, there is a point in that approach where it stops being productive.
<Munksgaard>
orbifx: Right you are. Thank you both for your help, I should probably go back to my (non-ocaml-related) work :-)
<orbifx>
Don't give up on ocaml :)
<Munksgaard>
orbifx: I was very close, after spending many a night getting this llvm tutorial working. I almost started on a Haskell version instead, and even contemplated just following the standard C++ tutorial! Ugh!
<Munksgaard>
I'm really intruiged by opam though, it seems like there are some great ideas, I just haven't been very lucky with it :(
<orbifx>
You don't need llvm to use ocaml
<orbifx>
I don't use llvm. It's better to start with the conventional tools.
<companion_cube>
I think Munksgaard is trying to use the llvm API
<orbifx>
gcc I think is still de facto
<Munksgaard>
orbifx: No no, but I want to implement my own language using LLVM, and since there was an official tutorial that uses OCaml, I thought it was a nice reason to learn me some OCaml also :)
<Munksgaard>
official llvm tutorial, that is.
<Munksgaard>
companion_cube: Exactly.
<orbifx>
ok
A1977494 has quit [Ping timeout: 264 seconds]
A1977494 has joined #ocaml
anoisz has quit [Read error: Connection reset by peer]
anoisz has joined #ocaml
AlexRussia has joined #ocaml
TheLemonMan has joined #ocaml
AltGr has joined #ocaml
AlexRussia has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
kaustuv has joined #ocaml
<kaustuv>
Any idea why I am seeing this and how to fix it?
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ygrek has joined #ocaml
xcaptain has quit [Remote host closed the connection]
octachron has quit [Ping timeout: 250 seconds]
sdothum has joined #ocaml
uriznik has left #ocaml [#ocaml]
anoisz_ has joined #ocaml
anoisz has quit [Ping timeout: 250 seconds]
<edwin>
ocaml IDE in F# - I miss the point, wouldn't you want to use your own IDE to write the IDE? (see latest entry on /r/ocaml)
<reynir>
It's the F# fanboy of /r/ocaml
BitPuffin has joined #ocaml
<pitastrudl>
there's also an ocaml sub? daym
<pitastrudl>
omg :D
AlexRussia has joined #ocaml
anoisz has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
anoisz_ has quit [Ping timeout: 240 seconds]
AltGr has left #ocaml [#ocaml]
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
anoisz has quit [Quit: Leaving]
<flux>
well, probably jdh30 wants to support F# as well
<companion_cube>
why would he write a F# IDE, when he has visual studio?
<companion_cube>
that doesn't make much sense overall
<flux>
not everyone is super-happy with vs.
<companion_cube>
well I doubt a single person could do better
<flux>
though I recall there was this one ocaml-written ocaml-ide
<flux>
companion_cube, they can do better for themselves.. :)
<flux>
ah, ocamleditor
<flux>
I guess it doesn't have merlin-level functionality though (or merlin support)
<flux>
I'm not saying redoing an existing project is somehow forbidden, of course :)
jonasen has joined #ocaml
<zozozo>
maybe we'lle see an ocaml ide with reason ?
<flux>
I wonder though. There is OCaml for JVM. wouldn't OCaml for .net be almost as useful.
<companion_cube>
meh, better use F# (which already has null and the proper OO convention)
<flux>
well, it isn't really super-useful if you want to compile native linux apps as well
<companion_cube>
with the same program? I doubt it's possible
<flux>
it's possible with C.
<companion_cube>
or even the right thing to do
<flux>
in fact, at my project we're targeting Linux, Windows, Android, iOS, OSX. not .net or .jvm though :).
<flux>
obviously there are parts that work only one of those platforms :)
two_wheels has joined #ocaml
sfri_ has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
Kakadu has joined #ocaml
sfri has joined #ocaml
unbalancedparen has joined #ocaml
kushal has joined #ocaml
kaustuv has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBird_ has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
huza has joined #ocaml
FreeBird_ has quit [Ping timeout: 240 seconds]
tautologico has joined #ocaml
Orion3k has quit [Remote host closed the connection]
<edwin>
ah lol haven't looked at who submitted it
Orion3k has joined #ocaml
Orion3k has quit [Read error: Connection reset by peer]
two_wheels has quit [Ping timeout: 244 seconds]
MercurialAlchemi has quit [Ping timeout: 250 seconds]
jonasen has joined #ocaml
<dexterph>
`ocamlfind ppx_tools/ppx_metaquot foo.ml out.ml` causes 'Failure("Ast_mapper: OCaml version mismatch or malformed input")', any guesses what could cause this? I'm on ocaml 4.03.0
<flux>
some part of your chain is not compiled with 4.03.0?
<Kakadu>
maybe tools expects .cmo file and you give .ml file
sh0t has joined #ocaml
<Drup>
dexterph: ppx_metaquot is a ppx rewriter, you can't use it on source files
huza has quit [Quit: WeeChat 1.0.1]
freehck has joined #ocaml
<freehck>
Hello.
<freehck>
People, I forgot. Buffer module is *not* thread-safe, right?
<flux>
correct
michipili has joined #ocaml
<freehck>
I suppose that Buffer.add_string is interrupted by another thread...
<freehck>
flux: thx
<flux>
none of the standard libraries are (regarding the ones where such insafety is possible)
<dexterph>
ah, got it, passing it to ppx_tools/rewriter works, thanks
<Drup>
dexterph: to do what you want, you can use either the -dsource option of the compiler, or ppx_toos/rewriter
<dexterph>
thanks Drup
freehck has quit [Remote host closed the connection]
freehck has joined #ocaml
circ-user-vkmXT has joined #ocaml
tmtwd has joined #ocaml
<orbifx>
Drup: did you get far with mirage?
michipili has quit [Quit: [BX] I'm out like a light...]
circ-user-vkmXT_ has quit [Ping timeout: 260 seconds]
freehck has quit [Ping timeout: 260 seconds]
michipili has joined #ocaml
michipili has quit [Client Quit]
tmtwd has quit [Ping timeout: 260 seconds]
michipili has joined #ocaml
Orion3k has joined #ocaml
Orion3k has quit [Read error: Connection reset by peer]
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
<michipili>
I made it 12 years ago, it workedperfectly :D
<def`>
made what?
sh0t has quit [Remote host closed the connection]
<michipili>
def`: 32b-64b upgrade :)
Munksgaard has quit [Quit: Leaving.]
sh0t has joined #ocaml
pierpa has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
MercurialAlchemi has joined #ocaml
michipili has quit [Read error: Connection reset by peer]
orbifx-m2 has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
Sorella has joined #ocaml
orbifx-m has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
yomimono has quit [Ping timeout: 252 seconds]
gustav___ has quit [Ping timeout: 276 seconds]
Rome- is now known as Rome
Rome has quit [Changing host]
Rome has joined #ocaml
sh0t has quit [Quit: Leaving]
dakk_ has quit [Ping timeout: 250 seconds]
NingaLeaf has joined #ocaml
rgrinberg has joined #ocaml
kolko has joined #ocaml
adim has joined #ocaml
adim is now known as SpiceGuid
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
dexterph has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 276 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
kolko has quit [Ping timeout: 276 seconds]
kolko has joined #ocaml
dexterph has joined #ocaml
yomimono has joined #ocaml
kolko has quit [Ping timeout: 250 seconds]
<orbifx>
windows kills my will to live
AltGr has joined #ocaml
sshine has joined #ocaml
<sshine>
hi. I'm missing List.null from SML. do I just check if something is = []?
<pierpa>
something = []
<sshine>
ok.
Algebr` has quit [Remote host closed the connection]
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
kolko has joined #ocaml
mbrock has quit [Quit: Connection closed for inactivity]
kolko has quit [Ping timeout: 250 seconds]
larhat has quit [Quit: Leaving.]
orbifx-m has quit [Read error: Connection reset by peer]
orbifx-m has joined #ocaml
Ravana has quit [Ping timeout: 246 seconds]
kolko has joined #ocaml
Ravana has joined #ocaml
<rand__>
when I try to upgrade Tyxml to version 4.0.0, Opam wants to downgrade and remove a lot of stuff... Might there be a way to fix?
<rand__>
.. or maybe more realistically - when will I be able to use the new version
<companion_cube>
tyxml 4 broke compatibility, I guess some packages didn't upgrade yet
<Algebr>
I thought drup found all thoses that depended on tyxml and updated the opam
atbagautdinov has joined #ocaml
<rand__>
companion_cube: Ok, do you think it'll take more than a couple of weeks?
<companion_cube>
I don't know, really
<rand__>
ok
wiredsister has joined #ocaml
<rand__>
I'm not using ocaml 4.03 yet so that could be part of the problem..? I were missing pkg's that had moved to 4.03
Kakadu has quit [Quit: Page closed]
jeffmo has joined #ocaml
govg has joined #ocaml
shinnya has joined #ocaml
kolko has quit [Ping timeout: 246 seconds]
seangrove has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
seangrove has quit [Remote host closed the connection]
<Drup>
Algebr: I did, which is why opam want's to downgrade :p
<Drup>
rand__: a couple more weeks for js_of_ocaml and eliom, yes
<Drup>
(I'm not involved in the others, so I don't know)
jeffmo has quit [Quit: jeffmo]
kolko has joined #ocaml
jeffmo has joined #ocaml
<rand__>
Cool, sounds good - will be nice to be able to throw camlp4 dependency in more of my code
<Drup>
rand__: you were using the tyxml camlp4 extension ?
<rand__>
Drup: Nop, I'll be using tyxml from now on so will avoid any camlp4 - have just been on a mission to begin switching everything else to ppx, and I know that the 4.00 version has ppx
orbifx has quit [Ping timeout: 264 seconds]
<rand__>
.. there is some stuff that I will miss a lot if I switch fully though... ocamltext with pcre extension, sqlexpr and 'parser' stream syntax
<rand__>
:/ biggest problem for me is merlin incompatibility
AltGr has left #ocaml [#ocaml]
<def`>
rand__: pinning the git version of merlin works for 4.03
<def`>
it works for most workflows, but we are still fixing issues. the more testers the quicker it will move :P
orbifx-m2 has joined #ocaml
<rand__>
works with camlp4??
<def`>
ahah, no :(
<rand__>
nooo just became a bit hopeful
<rand__>
(:
<def`>
sorry =), I mixed the part about 4.03, ppxs and camlp4... No, there is even less support (less hardcoded extensions)
<rand__>
ah - I guess it is general policy that camlp4 is dying?
orbifx-m has quit [Ping timeout: 276 seconds]
copy` has quit [Quit: Connection closed for inactivity]
<def`>
Yes. Camlp4 is no longer part of the ecosystem, afaict. Only for legacy stuff.
<rand__>
Ok
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
seangrove has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
adelbertc has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
jonasen has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
<Algebr>
Trying to add stuff for bytes.ml using Buffer but can't compile, buffer is in the same dir under stdlib, what gives
<Algebr>
And other modules are fair game to use it seems, since Char is used just fine
<Algebr>
oh LAME, its compiling with ../boot/ocamlrun ../boot/ocamlc -use-prims ../byterun/primitives -strict-sequence -absname -w +a-4-9-41-42-44-45-48 -g -warn-error A -bin-annot -nostdlib -safe-string -strict-formats `./Compflags bytes.cmo` -c bytes.ml , no stdlib. So char is not part of stdlib then??
<Algebr>
Char
<Algebr>
And why do this policy of no stdlib?
<companion_cube>
I suppose the bootstrap process doesn't rely on the stdlib
<companion_cube>
because of circular dependencies or whatever
<def`>
+1 :D
<Algebr>
then its still odd to me that Char is not part of stdlib
<companion_cube>
it is
<Algebr>
but then how is it compiling just fine when bytes.ml uses Char but the compliation flag says -nostdlib
connorjacobsen has joined #ocaml
<Algebr>
and where should I be adding new code for string operations, bytes.ml or string.ml or copy paste same thing in both
BitPuffin has quit [Read error: Connection reset by peer]
<companion_cube>
depends if it's on mutable strings or not
<Algebr>
that's assuming -safe-string
octachron has joined #ocaml
<companion_cube>
that's for the future anyway
<Algebr>
I don't need to do mutation
<Algebr>
wait, but does that mean that "123".[0] syntax won't work anymore in string.ml?
<companion_cube>
I think there's something about indexing operator overloading
<Algebr>
what the heck, string.ml freely uses List and Bytes
<octachron>
"123".[0] is transformed to '''String.get "123" 0''' in the parser
<Algebr>
okay so will that indexing syntax be deprecated?
<Algebr>
i liked it
<companion_cube>
I don't think so?
<companion_cube>
I think you will be able to define .{} and .{}<- (maybe also .[] and .[]<-) in any module
<Algebr>
Oh nice, when is that happening, modular implicits?
<def`>
hmm, I think this should be have more like labels (record fields disambiguation)
<def`>
thank relying on the complex semantics of modular implicits
<octachron>
as far as I know, the potential plan would be to have ".()" and ".length" as a sort of special record field for array data types
<octachron>
and ".[]" and ".{}" as user-definable operators for other types that does not fit in the array kind
<octachron>
so for instance, one could have "let f (s:string) = s.(0) " and define "let (.[]) dict x = Map.get x dict and let y = dict.["word" ] "
<def`>
ok
orbifx-m has joined #ocaml
two_wheels has joined #ocaml
orbifx-m2 has quit [Ping timeout: 276 seconds]
kolko has quit [Ping timeout: 276 seconds]
darkf has joined #ocaml
NingaLeaf has quit [Quit: Leaving]
<Algebr>
what the heck was mlt used for
atbagautdinov has quit [Quit: atbagautdinov]
jeffmo has quit [Quit: jeffmo]
<Algebr>
when pattern matching, wasn't there a new feature added where you could do something like | Some ("123" as g) ->
<Algebr>
ie I only want a variable binding on the payload, not on the whole thing which is what I'll get if I use as
<Algebr>
simple with records but constructor is diverging
A1977494 has quit [Ping timeout: 260 seconds]
<reynir>
I'm not sure what you mean, but | Some ("123" as g) -> is not new
A1977494 has joined #ocaml
<Algebr>
oh derp, I thought the as would bind the whole pattern
<flux>
hmh, other points: why one commit and two changes? why change the comment to lowercase ("deprecated") when it's not needed?
<octachron>
Algebr, sorry I was not clear enough, you cannot use the string.[index] syntax in String.ml
<flux>
also I think the extension doc string should be more precise about its behavior, for example it's a bit difficult to see if the file extension contains the . or not
<flux>
also I think the function is useless :)
<flux>
a better variant would be along the like string -> (string * string option) or just plain string -> (string * string)
<flux>
but that's just a suggestion.. :)
<flux>
I suppose the 'extension' is along the line with functions like 'check_suffix' and 'chop_suffix'
<flux>
so to get the part I was missing would be using chop_suffix and extension together
<flux>
however, the documentation string should really mention what it does with the . and suggest to use chop_extension to get the initial part.
<flux>
furthermore :) wouldn't it be ok to just 1) include the . in the extension and 2) return an empty string in that case? in that case let flargh filename = let ext = extension filename in let base = chop_suffix filename ext in ext ^ base would be an identity function for strings, seems like a decent property..
<Algebr>
this is a lot of words
<Algebr>
What do you mean about change the comment to lowercase?
<flux>
-(* Deprecated functions implemented via other deprecated functions *)
<flux>
+(* deprecated functions implemented via other deprecated functions *)
<Algebr>
oh derp, that must have been an emacs fat finger
<flux>
always check out diffs before sending out pull requests :/, in particular for whitespace errors
<Algebr>
I did check it, just D / d got past me cause that line move was needed anyway
<Algebr>
k, fixed and pushed
<Algebr>
Thanks octachron, flux!
yunxing has joined #ocaml
yunxing has quit [Client Quit]
slash^ has quit [Read error: Connection reset by peer]
tristero has joined #ocaml
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
saruta has quit [Ping timeout: 252 seconds]
<Algebr>
flux: actually, redoing like you mentioned
two_wheels has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux>
there is actually the function "The extension is the shortest suffix starting with a period and not including a directory separator, .xyz for instance." that defines extension as including the ., so that part would be similar then
<flux>
not sure if the tuple is really required, because there is indeed the chop_extension function already..
<Algebr>
no, just giving back ".ext"
rgrinberg has quit [Quit: WeeChat 1.5]
rgrinberg has joined #ocaml
ygrek has joined #ocaml
<Algebr>
How often are the minor releases done again, the z in x.y.z
<Algebr>
oh man, merlin not working with compiler sucks
<octachron>
however, there is some plan to have a shorter release cycle for 4.04
copy` has joined #ocaml
jeffmo has joined #ocaml
<flux>
shorter as with 4.02->4.03 I imagine, so shorter than 1.5 years.. ?
<Algebr>
how fast does haskell move? every six months?
<flux>
perhaps we'll see multicore alpha at fall
<flux>
but I don't know if it'll be a sign of 4.04 alpha at the same time or just 4.03+mc
<Algebr>
this is a syntax wart. have to do let g = !somethig in match foo with g -> ... can't do match foo with !something ->
<flux>
well ! is just an operator, you could just as well write let g = something.contents
<flux>
and matching with { contents = x } works
<flux>
of course, similar-ish special support has been built for matching lazy values, but at least lazy is a keyword you cannot redefine
<Algebr>
Oh right, because ! is an operator, but since it always references that field, the compiler should just do it for me
<flux>
so it doesn't always reference that field, because you can redefine it..
<adelbertc>
are there any plans on merging modular implicits into the lang?
<flux>
adelbertc, I understand there are still some unsolved problems in modular implicits
<adelbertc>
ah boo
<flux>
if they are resolved, it becomes more reasonable to consider it for inclusion
<Algebr>
ah, you mean redefine the ! itself
<adelbertc>
is it actively being worked on still?
<flux>
algebr, yes
<flux>
adelbertc, no idea, I haven't been really following
<flux>
can't find any changes to module implicits this year, so doesn't look great
<flux>
oh, I can, github graphs were a bit confusing or even broken
<rgrinberg>
when are default values for optional args evaluated? At definition or at call?
<flux>
rgrinberg, at call
<rgrinberg>
flux: just tested this as well - thanks.
<flux>
they can also depend on preceding arguments
<mrvn>
flux: aren't they evaluated by the callee?
* mrvn
remembers something about default values being "match val with None -> default | Some x -> x"
<octachron>
flux, definitively shorter than 1.5 years. How much shorter is hard to tell, however gasche mentionned a possible release late 2016 for 4.04 on lwn.net .
* mrvn
always hates that a polymorphic function can't have a default value because that would make it not polymorphic.
<orbifx>
ok. i think the blocking section guards are in the wrong places here
<orbifx>
The manual is not clear about this: what the global_register does
A19774941 has joined #ocaml
<mrvn>
orbifx: Line 69 should be line 71
<mrvn>
And line 70 doesn't work like that
<orbifx>
and remove 80 and 83?
<mrvn>
no
<orbifx>
ok, what's wrong with 70?
A1977494 has quit [Ping timeout: 272 seconds]
<mrvn>
you are registering an address on the stack (that you already registered as parameter) and then you leave the function. Now GC will overwrite random bits on the stack whenever it moves the closure.
<orbifx>
ok, how to I get the original address of the ocaml closure (function) rather than the stack address of the parameter there?
<mrvn>
also you never call ~QQmlPropertyMap() so you will leak memory
<mrvn>
What you do need is a custom block with finalizer
<orbifx>
for now, let's say the QQmlPropertyMap will live for the duration of the process' lifetime
<orbifx>
but yes, coming back to this, it will haev to be added cause it may not
<mrvn>
You store the QQmlPropertyMap and _func in it and register the _func as global root. Then in the finalizer you call the destructor, free the global root and disconnect the QT signal.
<orbifx>
until then, I need to understand what goes on behind the scenes with the CAML macros.
<mrvn>
store the QT connection object in the custom block too
<orbifx>
but how to I refer to the _func, so that I get the "original" address rather than the stack value? without using &?
<mrvn>
orbifx: that question makes no sense
<mrvn>
_func is always the original address
<orbifx>
let me say what I think happens now
<orbifx>
you told me that I shouldn't use the register_global on &_func, because it registers the address that _func has on the stack. Makes sense since its a value coming from the parameters.
<mrvn>
What happens now is that you trash the stack, the GC and use uninitialized values
<mrvn>
you can't use any of the CAML macros without holding the lock. That's you biggest mistake
<orbifx>
So how do I hold a valid value of _func after the caml_create_QQmlPropertyMap has exited and all that is left is the closure.
<orbifx>
ok
<mrvn>
by registering a global root to something that survives the function
<orbifx>
so the Module for example?
<mrvn>
no. nothing you have fits.
<mrvn>
as said, allocate a custom block
<orbifx>
and what is a custom block?
<orbifx>
(completely new to this topic, not there with the terminology yet)
<tormen>
Hi. I am trying to use pgocaml in utop and ... can't get it to work.
<Kakadu>
As I already said we should subclass QQmlPropertyMap and hold caml closure in the private field. So it will survive as long as property map survives.
<tormen>
First I got:
<tormen>
let row = PGSQL(dbh) "SELECT email from organizations_email";;
<orbifx>
kakadu: I think this subclassing business is not the best approach
<Kakadu>
mrvn: Yeah, I kind of remmeber your casting problem with Qt bindings
<Kakadu>
orbifx: and where are you currently planning to store the closure? static global array?
<mrvn>
kakadu: if you don't have inheritance then just never cast
<orbifx>
mrvn: when I used used Callback.register on the func passed as _func, the program was running ok. Was the a fluke?
<mrvn>
yes
<mrvn>
that code is broken on so many levels
<orbifx>
mrvn: I gathered that
<orbifx>
but what needs to be said, in case a generous and knowledgable soul is reading this, is that the guide can be written in a way better way "on so many levels"
<tormen>
I am stuck. If anyone could give me a hint to help understanding what's going on that would be great :)
<mrvn>
kakadu: you can't just subclass, you always also need a custom block to call the destructor at the right time.
<orbifx>
kakadu: also i think that we should be looking at the module instances or creating a record which holds was we need. Basically a more functional approach.
<tormen>
I am not sure what I have to do to make utop load the syntax extension defined by pgocaml.
<Kakadu>
tormen: you probably should paste somewhere everything you type in the toplevel, including ~/.ocamlinit
<tormen>
kakadu: ok
yomimono has quit [Quit: Leaving]
<mrvn>
orbifx: have you looked at my QT bindings?
sepp2k has quit [Quit: Leaving.]
<orbifx>
no but id like to
<orbifx>
link?
<orbifx>
i will also go through the guide more carefully
<orbifx>
maybe I will remember my frustration and write something better when i get to the bottom of this
connorjacobsen has quit [Remote host closed the connection]
<tormen>
kakadu: ah... VERY GOOD idea ;) ... while copy and pasting stuff I actually noticed that utop had printed BEHIND my command (in the same line) an error that I overlooked ;)
<pyon>
What are the relative advantages of Core vs. Batteries? How do I know which one is the best pick for a project?
<mrvn>
pyon: try and error
<tormen>
(the problem was: it tried to compile the SELECT but could not authenticate to postgresql as the current user)
<tormen>
(so I got a utop # let rows = PGSQL(dbh) "SELECT email from organizations_email";;FATAL: 28P01: password authenticatio
jeffmo has quit [Quit: jeffmo]
<orbifx>
mrvn: thanks, will check those tomorrow
<mrvn>
orbifx: I even handle the case of QT objects getting freed by QT while ocaml still has them alive and vice versa.
<tormen>
which I fixed calling env PGUSER=bla PGDATABASE=blub utop)
<orbifx>
whilst that is good you do that, I still need to understand the mechanics :) so maybe your code if more ... intuitive(?), than the manual
<mrvn>
orbifx: hardly. The problem is convoluted
<orbifx>
Also actually, i don't understand why there isn't a mechanism to hold the function I'm passing to be used as a callback.
<mrvn>
and Weak.t isn#t documented at all
<mrvn>
orbifx: there is, it's called register_global_root
<orbifx>
That function value will outlive the PropertyMap.
<mrvn>
orbifx: your problem is that you are trying to use a temporary to hold the value.
dexterph has quit [Ping timeout: 252 seconds]
<orbifx>
so how to I get the "permanent"?
<mrvn>
orbifx: that is a C problem. allocate it
<orbifx>
Somewhere in the GC's memory.. lies a function, which I have created in OCaml.
<mrvn>
or not user readable if you are back to the ring3 problem
<mrvn>
ups
<orbifx>
"value_changed"
<mrvn>
and you need to allocate space for a pointer to it and register that as root
<orbifx>
now we got to the bottom of what I needed :)
<orbifx>
and makes the mechanics that much clearer :)
<orbifx>
thanks
<orbifx>
and kakadu i still think we should make record which holds any parameters of a PropMap instance
<Algebr>
odd. I'm building a cmxa with -a and man page says that it embeds the original -cclib -ccopts given when creating the cmxa, but when I use the cmxa I get linking errors unless I add again the relevant linking ccopt, cclib flags.
<Kakadu>
which parameters?
<orbifx>
the callback function and anything else necessary for the particular property_map instance
<orbifx>
mrvn: and when one does Callback.register, does that register the function as a root?
<orbifx>
or in a root.. ?
<Kakadu>
as far as I know it doesn't
A19774941 has quit [Remote host closed the connection]
<Kakadu>
orbifx: i.e. record instead of subclassing?
<mrvn>
orbifx: Callback.register stores the closure in a global table where C code can look up the closure.
<orbifx>
kakadu: also the qobject data if possible could be stored in the record
<mrvn>
orbifx: but you are passing the closure as argument. Totaly unrelated
kushal has quit [Ping timeout: 276 seconds]
<orbifx>
yeah I appreciate that now. Just investigating methods to do this.
<Kakadu>
Okay, we will deal with that tomorrow
Kakadu has quit []
<mrvn>
orbifx: if you want stupid you could register the function under a generated random name and pass the name to the function instead.
unbalancedparen has quit [Quit: WeeChat 1.5]
<mrvn>
orbifx: you would leak memory though since the closure could never ever be freed.
<orbifx>
no C++ does name mangling and see how it worked for them :)
<mrvn>
I still think gcc should have a size_t mangle_name(const char *name, char *buf, size_t max_len); function programs could use to get the c++ name of a function.
<mrvn>
zzzZZZ
<orbifx>
my general approach (till I find something impassable) is to create a record with anything that PropMap needs to store, and link to it from the C.
<orbifx>
but I'm going to read and sleep now
<orbifx>
till tomorrow
<orbifx>
mrvn: I might need a refresher tomorrow if I get the chance to work on this.
clog has joined #ocaml
<orbifx>
night all
orbifx has quit [Quit: WeeChat 1.5]
f[x] has joined #ocaml
ygrek_ has quit [Ping timeout: 258 seconds]
<gasche>
flux: for the record, (ocaml foo.ml) or (ocaml -stdin < foo.ml) both evaluate phrases without toplevel noise
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
<Algebr>
I thought objects had their own header under caml/