<Algebr>
Does anyone do anything with Lua + OCaml?
<Algebr>
and if so...why?
hugomg has left #ocaml ["Leaving"]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jeffmo has quit [Quit: jeffmo]
nullcatxxx_ has joined #ocaml
keen___ has joined #ocaml
keen__ has quit [Ping timeout: 255 seconds]
<dmbaturin>
Algebr: Hhm, what are the ways to combine the two?
<Algebr>
I have no idea, hency my queyr
<Algebr>
query
<dmbaturin>
While we are at it, are there known easy ways to embed a scripting language such as guile scheme or lua into an ocaml program? :)
<Algebr>
hmm, maybe copy the way that nmap does it
<dmbaturin>
Ocaml/Scheme interface could even be typed I guess.
<dmbaturin>
Lua does have type when conversion would be both taxing and not very pretty anyway.
kandu has quit [Ping timeout: 264 seconds]
<Algebr>
what do you mean
<dmbaturin>
Algebr: Well, fetching Lua mutable hashes from its interpreter would not be very fast.
kandu has joined #ocaml
<dmbaturin>
And since it allows heterogenous keys and values, it would not be very convenient to work with.
antkong has quit [Quit: antkong]
<Algebr>
this sounds like reasons not to do OCaml + Lua
swgillespie has joined #ocaml
Algebr has quit [Remote host closed the connection]
<seliopou>
is there any decent tutorial that covers the Format module?
<seliopou>
specifically da boxes
<seliopou>
boxen
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dmbaturin>
seliopou: There is one on ocaml.org AFAIR, I don't remember how detailed it is though.
tmtwd has quit [Quit: Leaving]
swgillespie has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
palomer has joined #ocaml
<palomer>
hey guys
<palomer>
anyone here use cohttp?
ygrek has quit [Ping timeout: 268 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
natrium1970 has joined #ocaml
rgrinberg has joined #ocaml
<natrium1970>
I am very confused about calling OCaml code that’s been compiled to JavaScript (using js_of_ocaml) from JavaScript itself. I can’t find any compliable examples that do this, only incomplete code fragments in the js_of_ocaml docs.
<natrium1970>
OCaml functions that are compiled into JavaScript don’t seem to be visible as JavaScript functions at all, so I don’t see how to call them. Then I see this ‘Js.Unsafe.global##plop <- Js.wrap_callback f’ in the docs, but how does that code fragment get executed? I mean, if I want to call OCaml from JavaScript, I don’t have a way to executed the code quoted.
toomuchtvrotsurb has quit [Remote host closed the connection]
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
meiji11 has joined #ocaml
AltGr has left #ocaml [#ocaml]
AltGr has joined #ocaml
antkong_ has joined #ocaml
jmasseo has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
vgrbr has quit [Ping timeout: 264 seconds]
bjorkintosh has quit [Quit: Leaving]
FreeBirdLjj has joined #ocaml
bjorkintosh has joined #ocaml
Algebr has joined #ocaml
<Algebr>
I have now witnessed the most psychotic thing I have ever seen. The same exact code but built with different git commits of a makefile is determining whether the program runs or fails. The only difference is a cosmetic diff but its affecting my js_of_ocaml based program.
mac10688 has quit [Ping timeout: 264 seconds]
palomer has quit [Quit: palomer]
darkf has joined #ocaml
swgillespie has joined #ocaml
raphaelsss has joined #ocaml
palomer has joined #ocaml
raphaelss has quit [Ping timeout: 264 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
obadz has quit [Ping timeout: 268 seconds]
obadz has joined #ocaml
ygrek has joined #ocaml
<Algebr>
I have found the relevant difference. I was calling this Makefile function, define colorecho @tput setaf 6 ; @echo $1 ; @tput sgr0; endef
<Algebr>
<Algebr>
and giving me this useless typeerror as well, h=d,c=h,b,j,f=0,i=a.length;f<i;f++){b=a.charCodeAt(f);if(b<e){for(var^TypeError: a.charCodeAt is not a function
<Algebr>
nullcatxxx_ has joined #ocaml
small-wolf has joined #ocaml
<small-wolf>
Has anyone managed to install opam on fedora 22?
AltGr has left #ocaml [#ocaml]
natrium1970 has quit [Quit: natrium1970]
palomer has quit [Quit: palomer]
palomer has joined #ocaml
natrium1970 has joined #ocaml
Denommus has joined #ocaml
rgrinberg has joined #ocaml
<natrium1970>
Algebr: You mentioned js_of_ocaml. do you have any experience interfacing? ”regular” JavaScript with OCaml that’s been compiled to JavaScript?
<Algebr>
yea
<Algebr>
not that much though, and all just unsafe
antkong_ has quit [Quit: antkong_]
<natrium1970>
If I’m running a JavaScript program, I cannot figure out how to call OCaml.
<natrium1970>
(Not can I figure ot how to access JavaScript properties from OCaml)
<Algebr>
I called the JS from OCaml that then was compiled to js.
<natrium1970>
I need to be able to start with “real” JavaScript. The other way around is not an option
<natrium1970>
If this cannot be done, I”m going to have to ditch OCaml.
<Algebr>
That I don't know because I'm pretty sure that the ocaml created js will do a IFE
<natrium1970>
IFE?
<Algebr>
or whatever that idiom's accronym is
<Algebr>
its when you do this in js (function (......)))()
<natrium1970>
I don’t know JavaScript very well at all. I was hoping to be able to use QML and OCaml together, but if I can’t, I will have to use C++ instead
<Algebr>
Drup: would be better able to answer, I probably shouldn't even be.
<Algebr>
you were only using OCaml for js_of_ocaml?
<natrium1970>
You’re the only person with lifesigns tonight, and you mentioned js_of_ocaml, so I thought I’d ask.
<natrium1970>
I’ve used OCaml for other things.
<Algebr>
a bit quiet indeed
<natrium1970>
It’s a shame that OCaml is not more usuable for GUI and especially mobile apps.
<Algebr>
meh, I would probably prefer a more OO language for a GUI anyway
<Algebr>
I was mixing objective-c and ocaml for a GUI application :)
<natrium1970>
But what if the business logic is very suitable for OCaml, but you want a GUI.
<Algebr>
then you can I bet, via the C binding
sternenseemann has quit [Ping timeout: 264 seconds]
<natrium1970>
I tried using Objective-C and NeXTSTEP (precessor to OS X) back in 1994, and I never got the hang of it, and every time I try Mac’s supposedly-great development tools, it’s a diaster.
<Algebr>
Oh wow, I'm way out of my league here, much more experience. I actually like Objc, its not bad, gives me all the string that I hate dealing with in plain C without going full blown C++ kind of alternative to C. I don't use XCode, all in emacs and I have code completion, etc.
<Algebr>
string type issue*
<natrium1970>
No, you’re not out of you’re league. I’m just old.
<natrium1970>
I really do not understand JavaScript that well, so reading the output of js_of_ocaml is very difficult. Like I don’t know what (function (......)))() means.
<Algebr>
I think reading the output of js_of_ocaml is probably just gibberish in itself.... (function (....))() means its an anonymous function which is making function scope for the code inside the .....and it is immediately invoking itself.
<Algebr>
Since function scope is like the only real kind of scope in JS
<Algebr>
famous JS libraries do this, d3, jquery, etc.
AltGr has joined #ocaml
<natrium1970>
I also don’t know how to access “real” JavaScript properties from OCaml.
<Algebr>
I'm pretty sure it could be just Js.Unsafe.get "thing" "Other" or even Js.Unsafe.eval_string "foo[\"message\"]"
palomer has quit [Quit: palomer]
<natrium1970>
I don’t understand how to use js.Unsafe.get because its type is ‘a -> ‘b -> ‘c to give me a clue.
<Algebr>
its saying you can use whatever
demonimin has quit [Remote host closed the connection]
<natrium1970>
So get 23 1.234? What would that even mean?
<natrium1970>
The docs say that get o s would get the value of property s in object o, but I can’t tell what kind of thing I am supposed to pass for s and o.
demonimin has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<natrium1970>
Ugh. This is impossible. Maybe if there were decent docs.
<natrium1970>
Many of the examples in the js_of_ocaml docs won’t work for this because the global object will not be writeable.
<natrium1970>
(In the QML environment)
<natrium1970>
I don’t even know who to ask about this.
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ggole has joined #ocaml
Mercuria1Alchemi has joined #ocaml
antkong_ has joined #ocaml
<Algebr>
Could always try asking directly on the github issues page, I got help basicaly instantly
rgrinberg has quit [Ping timeout: 244 seconds]
Denommus has quit [Remote host closed the connection]
<natrium1970>
There seems to be a mailing list. I’ll try there.
AltGr has left #ocaml [#ocaml]
<natrium1970>
Ugh. I can’t even figure out how to post on the mailing list! Clicking the send button does nothing.
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
small-wolf has quit [Ping timeout: 246 seconds]
sternenseemann has joined #ocaml
SomeDamnBody has joined #ocaml
nullcatxxx_ has joined #ocaml
rgrinberg has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
meiji11 has quit [Remote host closed the connection]
Algebr has quit [Ping timeout: 240 seconds]
igoroliveira has quit [Quit: Connection closed for inactivity]
tane has joined #ocaml
slash^ has joined #ocaml
tane has quit [Quit: Verlassend]
obadz has quit [Ping timeout: 250 seconds]
obadz has joined #ocaml
sternenseemann has quit [Quit: Changing server]
sternenseemann has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 268 seconds]
sh0t has joined #ocaml
tane has joined #ocaml
moei has quit [Quit: Leaving...]
moei has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 256 seconds]
Haudegen has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 252 seconds]
Kakadu has joined #ocaml
sh0t has quit [Ping timeout: 255 seconds]
FreeBirdLjj has joined #ocaml
FreeBird_ has quit [Ping timeout: 272 seconds]
FreeBirdLjj has quit [Ping timeout: 244 seconds]
natrium1970 has quit [Quit: natrium1970]
larhat1 has quit [Quit: Leaving.]
orbifx1 has joined #ocaml
rgrinberg has joined #ocaml
SomeDamnBody has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 244 seconds]
aziem has quit [Ping timeout: 240 seconds]
mobius-eng has joined #ocaml
nullcatxxx_ has joined #ocaml
leowzukw has joined #ocaml
leowzukw has quit [Client Quit]
leowzukw has joined #ocaml
shinnya has joined #ocaml
nullcatxxx_ has quit [Ping timeout: 250 seconds]
^elyse^ has joined #ocaml
mort___ has joined #ocaml
^elyse^ has quit [Quit: Leaving]
^elyse^ has joined #ocaml
<Kakadu>
Well, some action about jsoo and QtQuick. That's good
antkong_ has quit [Ping timeout: 272 seconds]
antkong_ has joined #ocaml
^elyse^ has quit [Quit: Leaving]
raphaelsss has quit [Ping timeout: 260 seconds]
bjorkintosh has quit [Quit: Leaving]
mobius-eng has quit [Ping timeout: 246 seconds]
larhat1 has joined #ocaml
vgrbr has joined #ocaml
Kakadu is now known as Kakadu_afk
bjorkintosh has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
larhat1 has quit [Quit: Leaving.]
larhat1 has joined #ocaml
tane has quit [Quit: Verlassend]
antkong_ has quit [Quit: antkong_]
Kakadu_afk is now known as Kakadu
tomboy64 has joined #ocaml
<tomboy64>
i'm having problems with a package (libres3) failing against >=ocamlnet-4
palomer has joined #ocaml
<tomboy64>
it says equeue-ssl isn't there. and indeed it is not there. yet libreS3's docs claim, it's compatible with >=ocamlnet-3.7.4
<tomboy64>
so, is it cause equeue-ssl went away for good and libreS3 needs to change? or did my ocamlnet somehow not build right and equeue-ssl should be there?
<jmasseo>
good morning-ish. I'm gonna be taking the OCaml MOOC. Anybody have any good resources to recommend apart from the docs and 'Real World OCaml'?
<hugomg>
@jmasseo: are you looking for ocaml-specific stuff or anything FP-related?
<jmasseo>
More the former, but both.
<jmasseo>
I've done one other FP MOOC, but it was in Scala. I think I did 3/4s of the course.
<jmasseo>
I also didn't really like scala very much.
<tomboy64>
mooc?
<jmasseo>
what does it mean?
<jmasseo>
it's like a free college class
<jmasseo>
massive online open course?
<jmasseo>
massive open online course
<jmasseo>
whatever
<jmasseo>
good place to get a survey of new things.
<jmasseo>
like ocaml or functional programming or machine learning
<tomboy64>
ahhh
<tomboy64>
yeah, did a couple of those on coursera
<jmasseo>
this is put on by some french setup.
<tomboy64>
among one in scala
<tomboy64>
heh
<Drup>
jmasseo: you probably won't need any introductory work for this MOOC, it's going to start by the basics :p
<tomboy64>
in english?
<jmasseo>
yeah
<jmasseo>
i think?
<jmasseo>
my french is pretty bad
<Drup>
Yes it's in english :D
<jmasseo>
probably be a lot better at the end of the course!
<tomboy64>
i'd be interested if i didn't have a sload of work these days
<jmasseo>
i know that feel
<jmasseo>
i'm full remote so i'm just gonna slack a few hours a day.
* fds
is also taking the course.
<fds>
But yeah, it looks pretty basic.
<jmasseo>
OCaml looks cool because I can do it wrong so many different ways.
<fds>
I'm partly doing it to make it look more popular.
<jmasseo>
so you're not a neophyte?
<Drup>
I'm mostly register to it to answer questions on the forum :>
<jmasseo>
I'm reasonably capable in a stack of other languages, but I wouldn't say I'm competent in any functional language.
<jmasseo>
I solved a real problem in lisp once.
<jmasseo>
and sometimes i use functional idioms in ruby or python
<fds>
I'm not an expert programmer, but I've been playing with OCaml for a year or two now.
<fds>
I've never used it in anger, but still, I'm not sure the course will teach me anything.
* fds
shrugs.
<fds>
I wonder if there'll be an IRC channel specifically for the course.
Kakadu_afk is now known as Kakadu
<Drup>
fds: just use this one
<jmasseo>
never used it in anger?
<jmasseo>
yeah, i joined here because it came up in an irc search.
<jmasseo>
errr irc logs came up in a web log
<jmasseo>
err in a web search
<jmasseo>
i must be retarded today
<jmasseo>
so the ocaml 'toolchain' looks to be between 'go' and 'C' in complexity heh.
Lis has joined #ocaml
<Drup>
jmasseo: How is the go toolchain ?
<jmasseo>
lots of command line arguments and idioms involved.
<jmasseo>
Drup: a total crackparty masked by ome nice command line tools.
<Drup>
I see
<Drup>
yes, then
<fds>
Drup: Okay :-)
<jmasseo>
Go is based on the old plan9 compiler sets.
<tomboy64>
that one actually made me laff
<tomboy64>
cause i always thought that about C
<apache2>
jmasseo: there's an ocaml mooc? link?
<fds>
jmasseo: I meant that I've never used OCaml to solve a large/"real world" problem.
<jmasseo>
ah
<jmasseo>
i'm a sysadmin aka "dev ops" aka "infrastructure engineer"
<jmasseo>
so i do mostly programming 'in the small'
<jmasseo>
the real world problem i solved in list was loading data from files and sorting it back out into different files and outputting command sets, for instance.
<jmasseo>
when it was all refactored it was like 8 lines.
<dsheets>
I don't even what you don't even... just use a little run-time reflection and evade the type system with interface{} -- easy peasy!
<jmasseo>
go is special
<tane>
Drup, well, if paradigms do not match at all then things get harder :)
<please_help>
is it possible to create data with storage originating from C in caml, such as a C array allocated by malloc?
<please_help>
from ocaml*
<jmasseo>
yes?
<jmasseo>
there is a special type for it i think
echo-area has quit [Remote host closed the connection]
<Drup>
dsheets: I know, but still ...
^elyse^ has quit [Quit: Leaving]
<please_help>
any document on the subject? I see generic "interfacing with C" topics which seem to imply writing ocaml-compatible C wrappers is the only option to not cause memleaks in the process.
<dsheets>
please_help, ctypes can do this without writing the wrappers
<jmasseo>
that explains why i see so many ocaml wrappers?
<tane>
dsheets, are you working on some kind of golang-ocaml interfacing mechanism?
<jmasseo>
i'm a total noob.
<jmasseo>
can you interface golang with anything other than C?
<dsheets>
tane, just lexer, parser, ast for now
<tane>
nice
<jmasseo>
you might be able to create some sort of horrorstory.
<jmasseo>
but golang is statically linked so it's a pita to use it with other things
<dsheets>
1.5 introduced .o builds, iirc
<hugomg>
I thinks its reasonable to expect to have to write a wrapper to pass C stuff into a higher level language (or use some tool that builds the wrapper for you from a declarative spec)
<tane>
well, there is a possibiltiy to wrap your go code in some C-main, but i have not yet found a good solution to wrap it all up in some static lib
<Drup>
dsheets: really ? my apologies
<dsheets>
Drup, for what? i dislike go so much that the only way to tolerate it is to write manipulations in ocaml
<hugomg>
(ffw, I'm gonna plug Lua if anyone keeps asking about interfacing stuff with C)
<Drup>
dsheets: why are you doing that ?
<dsheets>
Drup, i don't know :-( boredom?
<Drup>
but why ?
<Drup>
even out of boredom, you can probably find something less heartbreaking that working *that*
<Drup>
(I didn't reviewed the patch, easier to read everything again for this kind of things)
<please_help>
I just tried binding malloc with 'external', hoping the memory block would be recognized by ocaml and correctly managed. It was a ridiculously bad idea.
<jmasseo>
MirageOS does not have a wikipedia entry
<Drup>
dsheets: I know, I saw the PR
<dsheets>
I don't even...
<Drup>
(Yes, I'm githubingly stalking you :D)
tmtwd has joined #ocaml
<tomboy64>
jmasseo: i would imagine something like docker: you create a "machine" just for one specific application. then dump it on the server.
<tomboy64>
jmasseo: with docker you create those machines from full OS-images. with mirage you basically create your own machine without all that messy overhead.
<jmasseo>
does mirage use the linux kernel?
<jmasseo>
or does it use a custom kernel?
<Drup>
neither
<tomboy64>
jmasseo: afaik it's supposed to run under xen and use their facilities
<tomboy64>
or basically everything ocaml can work with.
<Drup>
it can also run on the rumprun kernel
<tomboy64>
(but all that i told you is pretty much what i gathered from bits and pieces and may very well be wrong)
<dsheets>
rumprun kernel = netbsd split into libs
<jmasseo>
interesting stuff.
<jmasseo>
so if it runs on xen then i can deploy it to AWS right?
<jmasseo>
get a lot more milage out of those microinstances if you don't have any OS to deal with.
<tomboy64>
actually now that we talked about it i'm gonna mention it to $boss and see if he's game to switch from his rear-end-hat idea of plucking everything into docker
<tomboy64>
and instead switch to this kind of arch
<tomboy64>
plus i'd have a reason to deal with ocaml on a daily baisis
<tomboy64>
-i
<tomboy64>
and get away from $jvm
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
obadz- has joined #ocaml
mort___ has quit [Client Quit]
obadz has quit [Ping timeout: 250 seconds]
tmtwd has quit [Remote host closed the connection]
tmtwd has joined #ocaml
<jmasseo>
My only complaint with JVM is memory usage.
<jmasseo>
and years and years of bad java.
<jmasseo>
There is OCaml-Java too I see
<tomboy64>
bad java ...
<tomboy64>
part of my company's main product is based on libs from 2000
<tomboy64>
which haven't been touched since 2003
<tomboy64>
in java 1.5
<jmasseo>
could be worse
* tomboy64
shudders
<jmasseo>
one of my big problems with java is that it was introduced without any async i/o support.
<tomboy64>
heh
<jmasseo>
so we had like a decade of people learning the wrong way to do things
<jmasseo>
"just spawn a thread per socket and let the garbage collector clean it up"
<jmasseo>
as a sysadmin, all you are doing is causing me problems.
<tomboy64>
that's the next thing
^elyse^ has joined #ocaml
<tomboy64>
"oh, we also need a new db server. no less than 64gigs of ram please. 256 would be better, though"
<jmasseo>
1.4 introduced 'selectors'
obadz- is now known as obadz
<jmasseo>
256gb of ram? if you own your own kit, no problem. if you're in the cloud, welll......
<tomboy64>
hehehe
<tomboy64>
our stuff *IS* in the cloud
<jmasseo>
so i'm 100% cloud now.
<tomboy64>
the new db server alone is ~3000€ a month
<jmasseo>
i miss my own gear.
<jmasseo>
yeah
<jmasseo>
how much is the lease on that dell instead?
<jmasseo>
and half a rack
<tomboy64>
well, not cloud per se, data center
<jmasseo>
$378/mo to get a $13000 dell server with 256gb of ram and 2 E5-2698's.
<jmasseo>
servers are cheap except in the cloud.
<tomboy64>
how much i got to hate that term
<tomboy64>
back in 2005 when i buiilt my own set of scripts, nobody even thought about it and everyone thought i was nuts for doing "something like that"
<tomboy64>
"who needs that"
<jmasseo>
yeah
<jmasseo>
if you had realized then
<jmasseo>
ythat you could sell any boring sysadmin task as a cloud service
<jmasseo>
you'd be rich now
struktured has joined #ocaml
<tomboy64>
back in 2008 i wanted to program something like whatsapp for my neo freerunner
<tomboy64>
"hätte hätte fahrradkette" - the phrase a famous politician ruined his chance for chancellorship over here
<tomboy64>
meaning ... if i had ...
nullcatxxx_ has joined #ocaml
<struktured>
is there any syntax to derive a type from the signature of a value to the type implied by it's signature? Similar to "module type of ..." syntax, but with a single value, not a structure. eg. let foo () = "hello" ;; type f = typeof foo . or is thi sbasically the whole point of using modules in the first place?
<ggole>
There's nothing like that, no
<ggole>
You can sort of fake it with classes, but don't do that.
struktured has quit [Quit: Konversation terminated!]
struktured has joined #ocaml
<struktured>
is it even that useful? for some reason I found myself doing stuff like module type T = sig type f: int -> bar val f: f end then I realized it's annoying for the implementer of that module type to have to define the type too
<ggole>
A bunch of useful functors are defined using a type t, so it can be
<ggole>
If you don't have any use for that and defining the type is just makework, then that seems like a waste of time indeed.
<struktured>
yeah although I do like the way it looks
<struktured>
:)
<struktured>
maybe if I had a ppx extension..lol
<struktured>
thanks for your advice, I will probably drop the that design pattern unless I need it
<please_help>
I'm trying to install utop from source, but the config script is looking for a windows executable while I'm on linux. How do I fix it?
orbifx1 has quit [Quit: WeeChat 1.3]
mort___ has joined #ocaml
raphaelss has joined #ocaml
mort___ has left #ocaml [#ocaml]
mort___ has joined #ocaml
<struktured>
please_help: can you show the error? I just built it from source using master. I had to git clean -f -x -d and git reset --hard though to get rid of some garbage from previious build
<please_help>
Maybe I should have read the error message myself... "sed '/^#/D' setup.ml > setup_dev.ml" "ocamlfind ocamlopt -o setup-dev.exe -linkpkg -package ocamlbuild,oasis.dynrun setup_dev.ml || \" "ocamlfind ocamlc -o setup-dev.exe -linkpkg -package ocamlbuild,oasis.dynrun setup_devl.ml || true" "ocamlfind: Package `oasis.dynrun' not found" So, missing oasis.dynrun. Problem is that the script doesn't die when that happens so it goes on to ./setup-dev.exe
<please_help>
-configure, which is not found because it couldn't be built.
struktured has quit [Ping timeout: 246 seconds]
leowzukw has quit [Quit: WeeChat 1.0.1]
palomer has joined #ocaml
hugomg has quit [Ping timeout: 260 seconds]
palomer has quit [Client Quit]
palomer has joined #ocaml
darkf has quit [Quit: Leaving]
mehdi_ has quit [Remote host closed the connection]
mehdi_ has joined #ocaml
<please_help>
When trying to #require "ctypes.foreign" in utop, I get "No such package: ctypes.foreign.threaded - required by `ctypes.foreign'"
mort___ has quit [Quit: Leaving.]
mort___ has joined #ocaml
mort___ has quit [Client Quit]
mort___ has joined #ocaml
mort___ has quit [Client Quit]
<dsheets>
please_help, are you using opam? have you installed ctypes-foreign?
hugomg has joined #ocaml
nullcatxxx_ has quit [Quit: gone...]
nullcatxxx_ has joined #ocaml
<please_help>
dsheets: yes to both.
<please_help>
actually no, I thought ctypes and ctypes-foreign was the same thing
GeorgeHahn has joined #ocaml
<please_help>
now that it's installed, it seems to work, thanks.
<dsheets>
ctypes-foreign includes the stuff for dynamic binding (libffi binding which does various runtime activities like stack frame synthesis and closure generation to support function pointers)
<dsheets>
if you are using ctypes from utop, you need this runtime support but the recommended way to use it for a project is to use stub generation
<please_help>
looks like chapter 19 of real world ocaml is out of date, any other source of documentation about ctypes?
<please_help>
for instance, @-> doesn't seem to be recognized.
<please_help>
That works. (again, looks like that chapter is pretty out of date).
<please_help>
OK, but that won't ensure that free is used on pointers returned from C code when referencecount goes to 0, right?
<dsheets>
I don't see where RWO is wrong? The example opens Ctypes and then later opens Foreign
<dsheets>
what won't ensure it?
|jbrown| has joined #ocaml
<please_help>
Oh, you're right, it does open it. But it also doesn't opam install ctypes-foreign nor utop.
<dsheets>
i think it recommends utop somewhere... the ctypes-foreign thing is missing, though :-(
<please_help>
it uses utop for the #require (and I don't see an explanation of what to do at the default repl) but doesn't seem to install it (at least at this point - maybe earlier in the book?)
<dsheets>
yeah, i think it installs it toward the beginning of the book
<dsheets>
in a regular repl (which is painful to use, imo), you need to #use "topfind";; first
<please_help>
as for "what won't ensure it": I use malloc as a simple example. Whether I bind malloc from foreign or from external, the memory it allocates is never freed apparently.
Haudegen has quit [Ping timeout: 268 seconds]
<please_help>
so the question becomes: by which mechanism can I register foreign-allocated memory to be freed when it is no longer referenced?
<dsheets>
there is some distinction between allocating C memory from OCaml to be used by C functions and putting memory allocated in C under OCaml's GC management
<please_help>
As I said, I use malloc as a simple example. In reality, I call into a much more complicated set of functions in C which perform allocation.
<dsheets>
the latter sounds error prone but it is possible if you really require it
<dsheets>
ok, one moment
<please_help>
In other words, I want to allocate C memory from ocaml to be used by c functions while being under ocaml's gc management.
<please_help>
actually no, I'm confusing myself here
<please_help>
I want to allocate C memory from C to be used by C functions while being under ocaml's gc management.
<dsheets>
so if you can use normal Gc finalizers if you have an OCaml abstraction that encapsulates the C memory
<ggole>
I've never heard "strict" used in that sense before.
<Drup>
Is there someone from the arakoon team around ?
<Drup>
I would like to know the state of baardskeerder
Kakadu has quit [Quit: Page closed]
tomboy65 has joined #ocaml
tomboy64 has quit [Ping timeout: 256 seconds]
lobo has joined #ocaml
enamex has joined #ocaml
vgrbr has quit [Ping timeout: 250 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
raazdaan has joined #ocaml
raazdaan has quit [Max SendQ exceeded]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
raazdaan has joined #ocaml
|jbrown| has quit [Ping timeout: 265 seconds]
raazdaan has quit [Max SendQ exceeded]
slash^ has quit [Read error: Connection reset by peer]
swgillespie has joined #ocaml
Haudegen has joined #ocaml
vgrbr has joined #ocaml
swgillespie is now known as swgillespie[GT]
Kakadu has joined #ocaml
vgrbr has quit [Ping timeout: 240 seconds]
raphaelss has quit [Read error: Connection reset by peer]
mobius-eng has joined #ocaml
palomer has quit [Quit: palomer]
ygrek has joined #ocaml
palomer has joined #ocaml
|jbrown| has joined #ocaml
palomer has quit [Client Quit]
Haudegen has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
|jbrown| has quit [Ping timeout: 250 seconds]
Haudegen has joined #ocaml
<Drup>
what's the fancy way to parse binary data right now ? I know about bitstring (and the wip ppx equivalent)
ggole has quit []
<Algebr>
Drup: would bap have some helpers?
<Drup>
bap is for binary executable
<Drup>
(and bap is *ridiculously* too big. I just want parsing)
<Algebr>
Drup: I have a method signature in jsoo like: Js.Unsafe.any -> unit Js.meth Then I'm trying to pass it something of type foo but I get a complain, I thought the any type would mean I could pass whatever I wanted, I guess I have to explicitly coercce the types?
<Drup>
yes, you have to coerce manually
<Drup>
but, hum, you should almost have this kind of types
<Drup>
you should immediatly wrap it up under a safe interface
<Algebr>
Its a generic thing so it has to be any
<Algebr>
I don't know the type ahead of time
<Drup>
Can't it be < .. > Js.t ?
<Algebr>
Okay, maybe I'm doing something wrong. Here's the signature: method createServer_withapp : Js.Unsafe.any Js.t -> http Js.t Js.meth and I want the first argument which is of type http Js.t
<Algebr>
<Algebr>
What is the right way to do this?
<Drup>
the first argument of what ?
sh0t has quit [Ping timeout: 260 seconds]
<Algebr>
Sorry, wrote that wrong. I have this method called createServer_withapp : Js.Unsafe.any Js.t -> http Js.t Js.meth. I want to call it where the first argument I pass it is of a different type, its not an any type, its a specific one called express
<Drup>
I don't think you should have something of type any Js.t, it shouldn't happen
<Drup>
if you want "any object"
<Drup>
it should be of type 'a Js.t
<Algebr>
Isn't that the purpose of the type any Js.t?
<Drup>
if you also want to pass arbitrary things, like int/floats, or things that are normal ocaml types (for whatever reason), then you should use any
<Drup>
(and *not* any Js.t)
<Algebr>
this is very counter intuitive.
<Drup>
Is it ?
<Drup>
Js.t is for js objects
<Drup>
any is ... literally anything
<Algebr>
yes and I'm saying I want to pass any kind of javascript object to a javascript method.
<Drup>
well then you have your answer
<Algebr>
this is still uninitutive. I'm saying I want to pass any JS object but usage of the Js.Unsafe.any type doesn't capture that idea.
<Drup>
how the docs are written, you are supposed to fill the dots.
<Drup>
(you remark in relation to magic is highly amusing)
<Algebr>
stuff that generates code via syntax extensions isn't magic?
orbifx has joined #ocaml
rgrinberg has joined #ocaml
<Drup>
If you compare to the rest of the stuff done by js_of_ocaml, both the compiler and the syntax extension
<Drup>
No, it's not much more magical, really
<Algebr>
Drup: How do you capture the idea from JS about objects that are callable as functions but also have methods and properties like plain objects
tomboy64 has joined #ocaml
<Drup>
Algebr: bind the call method
<Algebr>
like this one... var a = require("foo"); and a.bar() and a() being valid. Can you provide an example?
<Drup>
(and create nice OCaml functions)
tomboy65 has quit [Ping timeout: 255 seconds]
<Algebr>
or where can I look for one
<Drup>
pretty sure a() is just a regular method call to the "call" method in js
<Drup>
I do not have example, but it should be similar
<Algebr>
Oh you mean implement the call method for the object
mobius-eng has quit [Ping timeout: 246 seconds]
palomer has quit [Quit: palomer]
dsheets has joined #ocaml
Algebr has quit [Ping timeout: 260 seconds]
palomer has joined #ocaml
palomer has quit [Client Quit]
tane has quit [Quit: Verlassend]
orbifx has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
palomer has joined #ocaml
palomer has quit [Client Quit]
palomer has joined #ocaml
palomer has quit [Client Quit]
antkong has joined #ocaml
^elyse^ has joined #ocaml
enamex has quit [Quit: Leaving]
|jbrown| has quit [Remote host closed the connection]
palomer has joined #ocaml
palomer has quit [Client Quit]
romildo has joined #ocaml
^elyse^ has quit [Quit: Leaving]
palomer has joined #ocaml
palomer has quit [Client Quit]
dsheets has quit [Ping timeout: 240 seconds]
mobius-eng has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
palomer has joined #ocaml
^elyse^ has joined #ocaml
ygrek has quit [Ping timeout: 272 seconds]
<apache2>
is Array.append an expensive operation?
<Drup>
it allocates a new array
<apache2>
so it's better to do increments of, say, 1000 elements than to append every time there's an addition beyond the current length?
<Drup>
Yes, you just re-discoevered buffers. ;)
<apache2>
fair enough :)
<apache2>
makes you wonder a bit why there isn't a generic Buffer module in the std library
<hugomg>
the standard library is lackluster. I recomend using Batteries
<Drup>
companion_cube: the link in containers' readme are broken
<apache2>
I've tried to avoid having to pick between extlib, containers, batteries and core so far
<Drup>
apache2: does the picking avoidance involves reimplementing everything ? :D
<apache2>
for no particular reason except lack of knowledge to form a proper informed opinion
<apache2>
Drup: it often does :(
pyx has joined #ocaml
<Drup>
there is a buffer in the stdlib, though, but only for strings
<apache2>
yes, a bit curious about that.
<apache2>
maybe I should just take your recommendation at face value and give it a try
<hugomg>
I would love to know the oppinion the rest of this channel holds regarding stdlibs
ygrek has joined #ocaml
<hugomg>
in my case I had troubles with core because the executables are large and its full of dependencies that make it harder to compile on windows / without opam / etc
Algebr has quit [Ping timeout: 240 seconds]
<hugomg>
I moved to batteries more recently and am liking it a lot so far (the pervasive iterator type is really nice)
<apache2>
I disliked how Core sort of forces you to buy into the whole thing
<Drup>
hugomg: Enum ? no it's not
<apache2>
and yes, extremely long compile times
pyx has quit [Client Quit]
<hugomg>
whats your beef with Enum?
<hugomg>
(genuinely curious)
<jmasseo>
thats a lot of stdlibs
<Drup>
slow, the API is bat, the semantic is ... weird, the implementation is insane
<Drup>
bad*
Algebr has joined #ocaml
<Drup>
If you want to stay in batteries, Batseq is much better
<Drup>
(otherwise, sequence all the way)
<hugomg>
why is there a difference between Enum and Batseq?
<Drup>
what do you mean ?
<Drup>
Why is BatSeq used instead of BatEnum ? I don't know, historical, I would guess. BatEnum can be duplicated lazily, and can be counted lazily (whatever that means)
<hugomg>
naively both sound like a simple "iterable". I am wonderring where the complexity you are talking about lies
<Drup>
cloning, count
<hugomg>
ah
<Drup>
cloning is a huge complexity
<hugomg>
well, thats a shame. kind of silly they made this choice I guess
<Drup>
indeed
shinnya has joined #ocaml
<jmasseo>
is there a reason to prefer one stdlib over another?
<jmasseo>
besides 'personal preference'
<Drup>
jmasseo: Not really. if you are working with a big lib using one, it might steer you one way or another.
<jmasseo>
is there support for asynchronous I/O beyond Unix.select?
^elyse^ has quit [Quit: I'm gonna sleep. Goodbye! :)]
larhat1 has joined #ocaml
Algebr has joined #ocaml
Algebr has quit [Ping timeout: 246 seconds]
<hugomg>
@drup: your comments have lead to investigate `containers` a bit more. I guess if I wanted something lighter than Core I should go all the way right? :)
Algebr has joined #ocaml
igoroliveira has quit [Quit: Connection closed for inactivity]
<jmasseo>
Lwt is interesting.
rand__ has joined #ocaml
<hugomg>
i just wish we could use the coroutines from 4.03 already instead of needing to use Futures. I still have nightmares from the days I programmed in Javascript and the farther we get from that the better :P
<Drup>
lwt has very little to do with js' async things
lobo has quit [Quit: leaving]
Mercuria1Alchemi has quit [Ping timeout: 256 seconds]
mort___ has joined #ocaml
<hugomg>
it has monads. thats enough to bring js-flashbacks for me :)
ygrek has quit [Ping timeout: 268 seconds]
mort___ has quit [Quit: Leaving.]
ygrek has joined #ocaml
<Algebr>
Drup: How can I add my own implemetnation of a method to a class type definition of a binding to a jsoo object
mort___ has joined #ocaml
<Drup>
I'm not sure I understand.
Kakadu has quit [Remote host closed the connection]
<Algebr>
class type foo = object .. end. there I can only provide definitions, not actual method implementations. but there is a method called foo that I want to provide the implementation of.
<Drup>
if that's not what you want, then I don't know, because what you are saying doesn't make the slightest sense. class type is for *types* that you give to pre-existing class. You wan't to change the method of something that exists ?
<Algebr>
I want to provide the implementation of a preexisting classes method
dsheets has joined #ocaml
<Drup>
how does that even work ? :|
<Algebr>
i want to monkey patch.
<Drup>
then monkey patch the object
<Drup>
but not the class, you can't monkey patch a class