<python476>
the makefile rule made it invisible .. I had to type it here to realize
<python476>
ironically, happens to me every month in python too
<python476>
haa newbery at its best
sigjuice_ has quit [Ping timeout: 265 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
sigjuice has joined #ocaml
BitPuffin has quit [Ping timeout: 256 seconds]
<Drup>
yeah. Redefining the modules in the stdlib is not a good idea :p
struktured has joined #ocaml
tennix has joined #ocaml
tennix has joined #ocaml
tennix has quit [Ping timeout: 240 seconds]
rand000 has quit [Quit: leaving]
jeffmo_ has quit [Quit: jeffmo_]
tmtwd has joined #ocaml
AltGr has joined #ocaml
tmtwd has quit [Read error: Connection reset by peer]
<python476>
So what do you guys use Ocaml for ?
freedrull has left #ocaml [#ocaml]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bmk1st has joined #ocaml
bmk1st has left #ocaml [#ocaml]
jeffmo has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Read error: Connection reset by peer]
MrScout has joined #ocaml
<struktured>
for starters, I wrote a python compiler and interpreter in pure ocaml
<struktured>
just kidding, but I bet someone already did
<python476>
mython, the objectless subset of python
toomuchtvrotsurb has quit [Remote host closed the connection]
tennix has joined #ocaml
<struktured>
nice
<struktured>
people use ocaml for anything really
<struktured>
perhaps it's traditionally use for parsers, code generators, theorem provers, etc.
swgillespie has joined #ocaml
mea-culp` has joined #ocaml
mea-culpa has quit [Ping timeout: 250 seconds]
jeffmo has quit [Quit: jeffmo]
<python476>
yeah, anything with recursive types / algebras will fit ml , they were born together
<python476>
but I was curious about you all there, not academics
<python476>
unless you're all PhD students and researchers :)
sailorswift has joined #ocaml
sailorswift has quit [Client Quit]
sailorswift has joined #ocaml
<Algebr>
python476: I use ocaml for everything
<python476>
Pizza and coffee
<python476>
** subtle proglang humor
<struktured>
well I use it professionally for some performance testing data analysis, as a hobby I am trying to do some reinforcement learning stuff
<Algebr>
I just did a hackathon, everything was ocaml. I used tyxml (OCaml to HTML) js_of_ocaml (OCaml to javascript)
<Algebr>
cohttp (for the server)
mcclurmc has joined #ocaml
sailorswift has quit [Max SendQ exceeded]
<python476>
pretty cool
MrScout has quit [Ping timeout: 244 seconds]
<python476>
and do you use other ml languages ? smlnj ? f# ?
tennix has quit [Quit: WeeChat 1.2]
mcclurmc_ has quit [Ping timeout: 260 seconds]
<Algebr>
no
sailorswift has joined #ocaml
<python476>
I can't say why but I felt smlnj easier to write with.. that's an interesting syntax issue, at least for me
<Algebr>
Is a pattern match on a string slower than say a match on a variant?
python476 has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 244 seconds]
MrScout has joined #ocaml
mea-culp` has quit [Remote host closed the connection]
tmtwd has joined #ocaml
darkf has joined #ocaml
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
samrat has joined #ocaml
Algebr` has joined #ocaml
sailorswift has quit [Read error: Connection reset by peer]
sailorswift has joined #ocaml
ygrek_ has quit [Ping timeout: 250 seconds]
shinnya has quit [Ping timeout: 240 seconds]
BitPuffin|osx has quit [Ping timeout: 252 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Bhavya has joined #ocaml
psy_ has quit [Ping timeout: 250 seconds]
MercurialAlchemi has joined #ocaml
Algebr` has quit [Remote host closed the connection]
toomuchtvrotsurb has joined #ocaml
toomuchtvrotsurb has quit [Ping timeout: 246 seconds]
ygrek_ has joined #ocaml
grouzen has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
siddharthv_away is now known as siddharthv
manizzle has joined #ocaml
psy_ has joined #ocaml
sh0t has joined #ocaml
GeorgeHahn has quit [Read error: Connection reset by peer]
<zozozo>
I'd say yes
<zozozo>
a variant is juste an int underneath
<zozozo>
and comparing int(s) is faster than strings normally (or else there is something really wrong happening)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
tmtwd has quit [Read error: Connection reset by peer]
kushal has joined #ocaml
sh0t has quit [Ping timeout: 252 seconds]
ely-se has joined #ocaml
AlexRussia has joined #ocaml
cschneid has quit [Ping timeout: 265 seconds]
tizoc has quit [Ping timeout: 265 seconds]
tizoc has joined #ocaml
cschneid has joined #ocaml
MrScout has quit [Ping timeout: 246 seconds]
Bhavya has quit [Ping timeout: 244 seconds]
meteo__ has joined #ocaml
<companion_cube>
Drup: of course there is, CCString.of_list
dwoos has quit [Ping timeout: 265 seconds]
dwoos has joined #ocaml
Bhavya has joined #ocaml
samrat has quit [Ping timeout: 272 seconds]
sailorswift has joined #ocaml
Haudegen has quit [Ping timeout: 272 seconds]
Haudegen has joined #ocaml
jonludlam has joined #ocaml
ygrek_ has quit [Ping timeout: 240 seconds]
jonludlam has quit [Ping timeout: 244 seconds]
antegallya has joined #ocaml
whirm has joined #ocaml
ely-se has quit [Quit: leaving]
tizoc has quit [*.net *.split]
obadz has quit [*.net *.split]
The_third_man has quit [*.net *.split]
SHODAN has quit [*.net *.split]
taion809 has quit [*.net *.split]
siddharthv has quit [*.net *.split]
tobiasBo1 has quit [*.net *.split]
dmbaturin has quit [*.net *.split]
tokik has quit [*.net *.split]
iZsh has quit [*.net *.split]
Cypi has quit [*.net *.split]
maurer has quit [*.net *.split]
pleiosaur has quit [*.net *.split]
LnL has quit [*.net *.split]
cow-orker has quit [*.net *.split]
tizoc has joined #ocaml
obadz has joined #ocaml
The_third_man has joined #ocaml
taion809 has joined #ocaml
tobiasBo1 has joined #ocaml
LnL has joined #ocaml
tokik has joined #ocaml
maurer has joined #ocaml
Cypi has joined #ocaml
siddharthv has joined #ocaml
dmbaturin has joined #ocaml
SHODAN has joined #ocaml
iZsh has joined #ocaml
cow-orker has joined #ocaml
pleiosaur has joined #ocaml
antegallya has quit [Quit: Leaving.]
antegallya has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
yomimono has joined #ocaml
antegallya has quit [Ping timeout: 244 seconds]
pyon has quit [Ping timeout: 250 seconds]
octachron has joined #ocaml
zpe has joined #ocaml
siddharthv is now known as siddharthv_away
dsheets has quit [Ping timeout: 244 seconds]
rand000 has joined #ocaml
kakadu has joined #ocaml
samrat has joined #ocaml
psy_ has quit [Ping timeout: 246 seconds]
psy_ has joined #ocaml
psy_ has quit [Ping timeout: 260 seconds]
dsheets has joined #ocaml
psy_ has joined #ocaml
meteo__ has quit [Ping timeout: 256 seconds]
meteo__ has joined #ocaml
octachron has quit [Ping timeout: 246 seconds]
rossberg has quit [Ping timeout: 244 seconds]
AltGr has left #ocaml [#ocaml]
xificurC has joined #ocaml
octachron has joined #ocaml
rossberg has joined #ocaml
seliopou has quit [Ping timeout: 252 seconds]
_ether_ has quit [Remote host closed the connection]
_andre has joined #ocaml
ely-se has joined #ocaml
GeorgeHahn has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
<Drup>
companion_cube: oh, indeed
<Drup>
and the name, while less cool, is more descriptive =')
<Drup>
Algebr: yes *but* pattern matching on string is quite fast
<companion_cube>
well yes, it sounds normal to call it 'of_list' :)
jonludlam has joined #ocaml
tane has joined #ocaml
kolko has quit [Ping timeout: 252 seconds]
sepp2k has joined #ocaml
zpe has joined #ocaml
kolko has joined #ocaml
pippijn has quit [Quit: Reconnecting]
pippijn has joined #ocaml
ollehar has joined #ocaml
lordkryss has joined #ocaml
grouzen has quit [Ping timeout: 244 seconds]
ericsmithvt has joined #ocaml
ceryo has joined #ocaml
tane has quit [Quit: Verlassend]
ceryo has quit [Client Quit]
ceryo has joined #ocaml
Bhavya has quit [Quit: Quit the channel]
Haudegen has quit [Ping timeout: 244 seconds]
sailorswift has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jonludlam has quit [Ping timeout: 260 seconds]
kushal has quit [Ping timeout: 255 seconds]
badkins has joined #ocaml
<ely-se>
Is js_of_ocaml any good?
Haudegen has joined #ocaml
<adrien_znc>
yes
<adrien_znc>
now
<adrien_znc>
if you ask Drup
<adrien_znc>
he'll tell you it's incredibly good (and he won't be wrong)
<mrvn>
good as opposed to bad or to evil? :)
<ely-se>
mrvn: "bad" can mean evil too!
jhaberku has joined #ocaml
<jhaberku>
I never appreciated before yesterday that Lwt is essentially the IO monad from Haskell, especially with the utop integration. Pretty neat stuff.
grouzen has joined #ocaml
samrat has quit [Ping timeout: 246 seconds]
<jhaberku>
I'd be tempted to wrap everything impure in Lwt.t, but I'm not exactly sure how I could write unit tests in oUnit against a Lwt function without invoking Lwt_main in multiple places. With a custom `IO.t` type that I wrote, there's the `IO.unsafe_perform` function that allows me to escape when necessary in tests.
<ollehar>
can I make ounit NOT test in parallell?
jonludlam has joined #ocaml
<companion_cube>
use OUnit instead of OUnit2
kushal has joined #ocaml
<ely-se>
run your tests on a single-core machine
<ely-se>
or a global mutex!
<zozozo>
ollehar: do something like ./test -runner sequential
<zozozo>
i had the smae problem
<ollehar>
zozozo: thanks, will look at that
jhaberku has quit [Remote host closed the connection]
jhaberku has joined #ocaml
tmtwd has joined #ocaml
tane has joined #ocaml
<Drup>
jhaberku: running multiple Lwt_main.run is fine, it's running *nested* Lwt_main.run that is a bit fishy
<Drup>
ely-se: It's very good. :D
* Drup
happily fulfill adrien's expectations.
<adrien_znc>
thanks
<adrien_znc>
although you took some time to do so
<adrien_znc>
I'm slightly sad
<ely-se>
Drup: I will try it maybe!
<Drup>
adrien: I was eating then attending a talk.
ely-se has quit [Quit: leaving]
igoroliveira has joined #ocaml
samrat has joined #ocaml
struktured has quit [Ping timeout: 250 seconds]
BitPuffin has joined #ocaml
<jhaberku>
Drup: Ah, good to know. Thanks! I might keep my `IO.t` around as a "this is a impure computation running synchronously always" and use `Lwt.t` as a superset that allows for concurrency.
<mrvn>
Does Core/Batteries have a heap / priority queue module that allows increasing the priority of an item or removing items *fast*?
<mrvn>
Actually make that changing the pririty (up or down)
<companion_cube>
I'm not sure it's possible unless you have a pointer on the item
<companion_cube>
(i.e. in an array-based heap)
<mrvn>
even an array based heap would need O(log n) correcting the priority
kerneis has quit [Quit: leaving]
<mrvn>
A wheel or bucket approach like Linuxes network code has would be nice.
<companion_cube>
I'm not sure, you can bubble up or down
<companion_cube>
if you have the index of the element
<companion_cube>
well yeah, ln(n)
<companion_cube>
it's pretty efficient
paddymahoney has joined #ocaml
<mrvn>
if you have 100000 items that change priority 1000 times a second that adds up.
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<companion_cube>
well, that's how SAT solvers manage their heuristics
<Drup>
can't manage to get rid of the shift/reduce conflicts, and obviously it doesn't work
marsam has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
rand000 has quit [Quit: leaving]
ygrek_ has joined #ocaml
octachron has quit [Quit: Leaving]
whirm has quit [Ping timeout: 244 seconds]
AlexRussia has quit [Ping timeout: 246 seconds]
whirm has joined #ocaml
jhaberku has quit [Ping timeout: 252 seconds]
jonludlam has quit [Ping timeout: 260 seconds]
ygrek_ has quit [Ping timeout: 250 seconds]
jhaberku has joined #ocaml
ely-se has joined #ocaml
blandflakes has joined #ocaml
whirm has quit [Ping timeout: 255 seconds]
jhaberku has quit [Ping timeout: 246 seconds]
pyx has joined #ocaml
pyx is now known as Guest50802
Guest50802 has quit [Client Quit]
<ely-se>
Is there a recommended high-level library for spawning processes? Sys only has command which takes a shell command, but I want to pass arguments without shell injection vulnerabilities.
kakadu has quit [Ping timeout: 246 seconds]
<adrien_znc>
ely-se: Unix has more stuff
<adrien_znc>
you can also look at Lwt
<adrien_znc>
if you want to do it without blocking that is
<adrien_znc>
(although you could run an lwt specifically for that task)
<ely-se>
Ok, I'll use fork/exec. Thanks!
dsheets has quit [Ping timeout: 260 seconds]
meteo__ has quit [Ping timeout: 264 seconds]
grouzen has quit [Ping timeout: 255 seconds]
MrScout has joined #ocaml
<adrien>
ely-se: no, I meant open_process*
<ely-se>
takes no argument list
<adrien_znc>
right, I got it wrong again, I was thinking of create_process
<ely-se>
In retrospect I'd have written my compiler in OCaml, but I didn't know the language back then. I chose Elixir because I could easily add arbitrary data to the AST, but I figured that with OCaml's module system and structural type system this would be easy as well *and*_statically_ typed
<jrslepak>
I've had some trouble getting that to be as flexible as I would like, actually
<ely-se>
What trouble?
<ely-se>
Maybe I'll rewrite it.
<jrslepak>
I want to have, say, a typechecking pass that takes an AST where nodes are annotated with I-don't-care-what-data and produces an AST where nodes have all that old info *and* a `typ option'
<ely-se>
yes, I want that too.
<ollehar>
jrslepak: %"$a" is a local variable called $a
<ollehar>
% for local, @ for global
<jrslepak>
and later, I want to consume ASTs where annotations have I-don't-care-what as long as it includes a `typ option'
<ely-se>
a name resolution step and type checking step
<jrslepak>
row polymorphism seems like the obvious solution to that problem
<jrslepak>
ollehar: and you're selecting out of a struct with that? or is ([4 x i8]* @asd, i32 0, i32 0) an array type?
<ollehar>
jrslepak: [4 x i8]* is a global string, with content "asd", called asd.
<ollehar>
I want to let my local variable point to this string.
<ollehar>
string = array type, yes.
<jrslepak>
ely-se: but in order to use row polymorphism in OCaml, you have to be working with objects, which AFAICT means you can only get that "all-methods-from-this-row AND this additional one" by declaring a new class
lordkryss has joined #ocaml
<jrslepak>
ollehar: what about the `, i32 0, i32 0'?
<ollehar>
jrslepak: you can write object type directly in function signature too, like < a : int, b : string, ... >
<ely-se>
yeah, you can say "let tree = object method sym = 1 end;;" and "let tree = object method typ = 2 end;;" but I don't see a way to merge them
<ely-se>
prototypical inheritance would be great but I don't know any statically typed language that has that
<jrslepak>
first-class classes would do it too
<ollehar>
jrslepak: about i32 0, I don't know...
claudiuc has quit [Ping timeout: 246 seconds]
<jrslepak>
ollehar: are you sure that bit `(thing)' isn't a struct type?
<ollehar>
first-class classes is possible if you wrap them in modules?
ericsmithvt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ely-se>
I'm also not entirely sure on how to organise name resolution so that the type checker can easily track the types of variables.
<ely-se>
I guess the type checker could record the type of the variable in a "(Id.t, typ) map" where the ID refers to the variable declaration, and the symbol refers to the same ID
<ely-se>
Is it possible to make A a submodule of B if B resides in b.ml and A in b/a.ml?
<def`>
Drup: still in need of help?
<ely-se>
Such that you must write B.A instead of just A
<ely-se>
If not, how do you prevent name collisions between different libraries?
<Drup>
def`: yep
<Drup>
def`: the situation didn't changed :)
_andre has quit [Quit: leaving]
shinnya has joined #ocaml
xificurC has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
<mrvn>
ely-se: module B = struct include B end in a.ml. But that doesn't help the name conflict. You have to name b.ml unique or make a pack with a.ml and b.ml.
sh0t has quit [Ping timeout: 250 seconds]
<mrvn>
sorry, s/A/B/ s/B/A
<mrvn>
ely-se: It's common to have a <LIB>.ml that includes <LIB>A, <LIB>B, ... as submodules and nothing else.
<mrvn>
(or something else next to the submodules come to think of it)
<jrslepak>
ollehar: yeah, first thing I'd try for debugging this is to check the lltype of value_expr_code
<ollehar>
jrslepak: ok, thanks for taking your time, I will check.
<ely-se>
mrvn: ok
<ollehar>
jrslepak: the type is i8*
Haudegen has quit [Ping timeout: 250 seconds]
<jrslepak>
strange... seems like that should work
<jrslepak>
(although it also seems like that shouldn't put [4 x i8]* in the generated code)
dejanr has joined #ocaml
<ollehar>
jrslepak: yeah, but if you look at the code generated from the C source:
<ollehar>
%str = alloca i8*
<ollehar>
store i8* getelementptr inbounds ([14 x i8]* @.str, i32 0, i32 0), i8** %str
<ollehar>
the target of store is a pointer to i8*, that is i8**
<ollehar>
so I need to get the pointer to `variable` in my case. possibly.
<ollehar>
just speculating here.
jonludlam has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]