<ebzzry>
or, how can I simulate the use of the `-I' switch of ocamlc/ocamlopt in an _oasis file?
hhugo1 has quit [Quit: Leaving.]
ggole has joined #ocaml
pyon has joined #ocaml
tani has joined #ocaml
tane is now known as Guest44995
Guest44995 has quit [Killed (morgan.freenode.net (Nickname regained by services))]
tani is now known as tane
tane has quit [Quit: Verlassend]
zpe has joined #ocaml
zpe has quit [Ping timeout: 272 seconds]
<flux>
ocaml-top, seems pretty nice concept for someone learning/playing around with ocaml (available in opam)
<flux>
simply split-screen where program is on the left and toplevel on the right; play-button sends everything after to topmost modification to the toplevel and restarting toplevel is simple
<flux>
too bad it probably won't be too easily be able to make use of annotation files
<ggole>
Hmm, I have a bunch of emacs hacks that do most of that
<ggole>
Because the workflow of getting updated definitions into the toplevel with the regular tools is anything but smooth
zpe has joined #ocaml
Submarine has quit [Remote host closed the connection]
<whitequark>
artagnon: hm, what are you doing?
<whitequark>
oh, right, mcjit is not directly exposed in bindings
<ggole>
Security issue? Surely ocamlbuild can't be expected to operate safely on untrusted input.
<bfn>
if you create an x.ml file, then chmod go-rwx on it, then run `ocamlbuild x.native` it’ll copy that x.ml file into _build and change its permissions, so anyone with access to the current directory (other than the owner) can’t read x.ml but can read _build/x.ml, thanks to ocamlbuild
<ggole>
Ah, I see
<adrien>
yay for calls to 'cp'
<mrvn>
1) stupid mode, 2) missing option in cp
<whitequark>
that's not very serious, but I see how that can be problematic...
<artagnon>
whitequark: The shim will soon be removed, no?
<artagnon>
Can I help with create_mcjit? What should I do?
zpe has joined #ocaml
<whitequark>
artagnon: no, it won't
<whitequark>
hmmm
<whitequark>
artagnon: look at include/llvm-c/ExecutionEngine.h
<whitequark>
go to bindings/Ocaml/llvm_executionengine.ml
* artagnon
looks
<whitequark>
remove all usage of deprecated C functions, implement all missing functions
<whitequark>
the overall ExecutionEngine interface is nearly same for JIT/MCJIT, however MCJIT adds a few functions
<whitequark>
essentially the only things you will need is to handle LLVMMCJITCompilerOptions
<whitequark>
and also possibly mcjit memory managers, though I'm not sure if you can implement those in OCaml (probably not)
<artagnon>
Do you have a small task you can give me first?
<whitequark>
make a binding for LLVMCreateMCJITCompilerForModule.
<artagnon>
Ok.
<whitequark>
it should accept a record with the same file as struct LLVMMCJITCompilerOptions contains and convert the record to struct LLVMMCJITCompilerOptions.
<whitequark>
yes, but the names are all wrong, the binding uses different conventions elsewhere
<artagnon>
Oh.
<artagnon>
Where can I find the conventions?
<whitequark>
eg in Llvm module
<artagnon>
type t?
<artagnon>
module = struct which contains a type t?
shinnya has quit [Ping timeout: 260 seconds]
<artagnon>
I think the ll prefix should be dropped.
<artagnon>
Because these are not opaque pointers to values in llvm.
pharpend_ has joined #ocaml
<artagnon>
They're OCaml values.
<pharpend_>
Good morning, everyone
<pharpend_>
or, I guess, really late morning
<pharpend_>
anyway
<whitequark>
artagnon: yep, module CodeModel = struct type t = | Default | JIT_default | Small | Kernel | ... end
* artagnon
nods
<pharpend_>
Let me preface this by saying that I have no intention of starting a flame war. I'm reading through Real World OCaml. I already know Haskell pretty well. Would someone care to explain some of the differences between OCaml and Haskell? So far, OCaml just seems like Haskell with simpler syntax and less type safety.
<whitequark>
artagnon: and record files should be under_scored
<whitequark>
opt_level, code_model, etc
<whitequark>
record fields*
<artagnon>
Okay.
<whitequark>
you also should write a test in test/Bindings/Ocaml
<artagnon>
Will do.
<whitequark>
after that I'll be able to commit it, most likely
divyanshu has quit [Quit: Computer has gone to sleep.]
dav has quit [Remote host closed the connection]
divyanshu has joined #ocaml
ysz has quit [Remote host closed the connection]
<artagnon>
whitequark: There's no existing test for create_interp or create_jit?
<hugomg>
@pharpend_: Ocaml has some neat features Haskell doesnt have, like the module system / functors and row-polymorphic variants. For example, check out the tyxml library for something thats quite tricky to write in Haskell.
<pharpend_>
row-polymorphic variants sound nice
<whitequark>
artagnon: there is, executionengine.ml / test_executionengine
<pharpend_>
how are functors in ocaml different from those in Haskell?
<whitequark>
maybe parameterize the test functions with the jit creation function
<pharpend_>
I don't see how tyxml is different than blaze-html (I'm fairly certain there's an XML analog)
<hugomg>
they only have the name in common. Ocaml functors are module-level functions (writing a module that abstracts over another module's interface). Haskell functors are a type class (something ocaml lacks for now)
<artagnon>
Okay, but who will call them with the right arguments?
<whitequark>
see the bottom of the file
<artagnon>
Oh, let _ =
ygrek has joined #ocaml
<pharpend_>
i see
<hugomg>
in a way, Ocaml functors kind of do the same things Type classes do, but in a different way. There are pros and cons to both approaches
<pharpend_>
I can sort of imagine
<pharpend_>
I'm almost to the functor chapter in RWO
<whitequark>
in fact, implicits in OCaml, which are an experimental feature that may or may not be merged, are based off functors
<whitequark>
implicits ~ typeclasses
<pharpend_>
OCaml's implicit sum types have better naming conventions
<whitequark>
implicit sum types?
<pharpend_>
Umm
<pharpend_>
Haskell has the Maybe type, which is analogous to OCaml's option
<pharpend_>
with option, you can have Some x or None
<pharpend_>
with Maybe, you can have Just x or Nothing
<hugomg>
ADTs work pretty similar in Haskell and Ocaml (other than lazyness)
<whitequark>
oh, you mean builtin types
<ggole>
OCaml simply took SMLs
<pharpend_>
hugomg: even then, you can force strictness in Haskell
<ggole>
Dunno why Haskell changed things around
<hugomg>
yeah, but its a pita to add !s everywhere :) And you can use lazyness in Ocaml if you want too but its a bit verbose
<pharpend_>
hugomg: if you want to talk about pitas, I'd be happy to discuss ;;
<pharpend_>
on colemak, that's a very annoying key to type
<whitequark>
you don't ever need ;; except in toplevel
<pharpend_>
Maybe I'm too used to Haskell, where like 20% of your work is in the REPL.
<whitequark>
... and you get what you deserve for using weird layouts for programming, too. ; is one of the most used symbols in the majority of languages
<reynir>
whitequark: thanks a lot :)
<pharpend_>
I'm well aware
<artagnon>
whitequark: How do I run only that test?
<hugomg>
eh, after dealing with "=" in the Lua toplevel, Ocaml's ;; is nothing :)
<pharpend_>
hugomg: never used lua, but I have yet to hear anything good about it
<whitequark>
artagnon: oh, it's a bit of a pain, hang on
<ggole>
I found the ;; in toplevel pretty annoying until I taught emacs how to enter it for me
<artagnon>
:\
<pharpend_>
ggole: i should do that, would you mind sharing the script?
<hugomg>
lua is awesome, its just that until very recently you needed to type "=" at the start of every toplevel expression
hhugo1 has joined #ocaml
<pharpend_>
i see
<hugomg>
I mean, as far as the dynamic languages go, its pretty simple and reasonable. it even has tail recursion!
<ggole>
It's pretty much binding RET to (insert ";;") (tuareg-interactive-send-input)
<whitequark>
you could not possibly have successfully used it, ever.
r0ok has quit [Quit: leaving]
* adrien
hands whitequark a tissue
<whitequark>
oh, it worked before MCJIT migration, I think.
hausdorff has quit [Ping timeout: 255 seconds]
<whitequark>
... MCJIT cannot pass arguments to functions.
<whitequark>
like, at all.
<whitequark>
unless it's main(), then sure.
<whitequark>
what.
<def`>
pass arguments?? you can't call anything :p?
<whitequark>
you can, as long as it has no arguments
<whitequark>
you'll even get the return value back.
rand000 has quit [Ping timeout: 240 seconds]
rand000 has joined #ocaml
<ggole>
Wow, luxurious
Submarine has joined #ocaml
Submarine has joined #ocaml
<def`>
you generate a nullary function callng your n-ary functions withbhardcoded arguments :'
<whitequark>
no, you get a pointer to function and use libffi on it, basically
<whitequark>
... except OCaml bindings don't actually expose that functionality
<whitequark>
haha this is so broken
<whitequark>
all of it
<whitequark>
I made tests pass ...
<whitequark>
... essentially by commenting them out ;_;
<whitequark>
begin match engine with
<whitequark>
| `MCJIT -> () (* Currently can only invoke 0-ary functions *)
<whitequark>
| `JIT -> () (* JIT is now a shim around MCJIT, jokes on you *)
AlexRussia has quit [Ping timeout: 245 seconds]
<Drup>
meh
tane has joined #ocaml
<Drup>
I want to use [@depreacated] but i need to stay compatible with previous versions :(
mcclurmc has quit [Remote host closed the connection]
<whitequark>
artagnon: r220619 r220620
<whitequark>
see backlog; this is actually not enough to run meaningful code
AlexRussia has joined #ocaml
<whitequark>
what you need to do now is to expose LLVMAddGlobalMapping
<whitequark>
and LLVMGetPointerToGlobal
<whitequark>
then I think you could actually run the functions using ctypes
ollehar has joined #ocaml
mcclurmc has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
samrat has quit [Quit: Computer has gone to sleep.]
hhugo1 has quit [Quit: Leaving.]
Hannibal_Smith has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 245 seconds]
NoNNaN has joined #ocaml
axiles has quit [Remote host closed the connection]
michipili has joined #ocaml
michipili has quit [Client Quit]
nicoo has joined #ocaml
hhugo1 has joined #ocaml
mcclurmc has quit [Remote host closed the connection]
divyanshu has quit [Quit: Computer has gone to sleep.]
rand000 has quit [Ping timeout: 272 seconds]
ygrek has quit [Ping timeout: 260 seconds]
pharpend has quit [Quit: WeeChat 0.4.3]
pharpend has joined #ocaml
<flux>
nice, on ocsigen.org the big four links don't work (ie. for eliom) if you don't have cookies enabled :/
<flux>
if someone is new to ocaml and would like to start with web applications, what's the best way to go? I'm thinking not ocsigen..
<adrien>
Drup: quick!
<Drup>
yeah, I was testing without js
<Drup>
and it works
<Drup>
so i'm not sure what to say.
<flux>
well, I have js enabled, but not cookies, except on select sites
<flux>
and ocsigen.org is now one of the select sites :)
<Drup>
this is slightly weird
<Drup>
flux: which browser ?
<flux>
firefox (debian iceweasel 31.2.0)
<flux>
I removed the cookie, blocked it again, and now again stops working
<flux>
in fact, it's all links that don't work
<Drup>
indeed. I suppose someone assumed that if js was enabled, cookies were enabled too
<Drup>
the bug is triggered only if you have js but not cookies
<flux>
tried disabling cookies while still having the one from the site. doesn't work either. but could be it's the same as if I had just removed the cookie.
araujo has quit [Ping timeout: 272 seconds]
araujo has joined #ocaml
<Drup>
flux: I just need to check if it's only for ocsimore or for every eliom app using the shiny client reloading stuff
<Drup>
yeah, ok, it's for the shiny client reloading stuff
<flux>
I love these automatic irc-to-bugtracking-systems!
<Drup>
well, this one is a big one, it should be fixed. Some people took quite a great care of preserving the history and stuff like this even with partial page reloading.
<Drup>
it's a bit sad everything breaks just by disabling cookies x)
<flux>
too much magic error ;-)
<flux>
what does the stuff do? in this case probably not that much?
axiles has joined #ocaml
<flux>
hmm, that graph viewer is pretty nice demo and relevant to my interests
<Drup>
in case of ocsimore (which is the wiki/CMS/... used by ocsigen.org) it's probably not used all that much
<Drup>
Basically, it preserves the state of the js across link clicking
<Drup>
and reload the page only partially, by fetching the necessary html
<Drup>
(you can disable this whole thing, of course)
<flux>
pretty nice if it works without much effort from the application writer, though
sheijk has quit [Quit: .]
<Drup>
It's quite painless from the application writer point of view, yes
<Drup>
(mostly, you don't realize it)
<Drup>
as for the original question
zpe has joined #ocaml
<flux>
I suppose there is no book learning OCaml with Ocsigen ;-)
<Drup>
eliom uses lot's of feature that are considered "advanced" in OCaml, and is quite ""rich". So it can be a bit daunting
<Drup>
and no, there is no ocsigen book. The tutorials are actually good now, but could certainly use some improvements
<Drup>
flux: how new to ocaml is the person, and how long do you have ?
<Drup>
and what do you want to do
zpe has quit [Ping timeout: 250 seconds]
rand000 has joined #ocaml
<flux>
well, I'm just wondering if I were to suggest learning ocaml to someone currently doing web development in the dynamic languages, what would be the way to go, or if there is a way
<Drup>
ah, right
<Drup>
ocsigen would probably a quite violent choc :D
<flux>
I'm thinking the same as well ;)
<Drup>
flux: if it's a front end guy, you can start by making him use js_of_ocaml
<Drup>
baby steps, all that :p
ollehar has quit [Ping timeout: 255 seconds]
jonludlam has joined #ocaml
<Drup>
flux: if you want something very light, there is opium. I'm a bit reluctant to advise it, because I mostly consider it a circumcised eliom.server
<Drup>
it's only server side and it's quite small
<Drup>
I wonder if we could do a baby-interface for eliom.server that would look like opium
araujo has quit [Ping timeout: 255 seconds]
araujo has joined #ocaml
Unhammer has quit [Remote host closed the connection]
araujo has quit [Excess Flood]
araujo has joined #ocaml
<rand000>
Hello - I'm having an error when installing a dependency, ppx_tools, after upgrading opam to 1.2.0; from stderr > http://paste.in.ua/9969/
WraithM has quit [Ping timeout: 265 seconds]
<rand000>
.. someone who has a quick fix? - utop, lambda-term, lwt, sqlexpr fails to install because of it :/
<whitequark>
I should just clean whitespace in the whole binding and be done with it. this is generally discouraged, but hell, I'm the maintainer anyway
<Drup>
oh, yes, please
jonludla` has joined #ocaml
jonludlam has quit [Ping timeout: 240 seconds]
Unhammer has joined #ocaml
badon_ has joined #ocaml
kakadu has quit [Quit: Konversation terminated!]
jonludlam has joined #ocaml
badon has quit [Disconnected by services]
jonludla` has quit [Ping timeout: 244 seconds]
badon_ is now known as badon
hugomg has quit [Ping timeout: 255 seconds]
hausdorff has quit [Remote host closed the connection]
pharpend has quit [Quit: WeeChat 0.4.3]
pharpend has joined #ocaml
larhat1 has quit [Quit: Leaving.]
hugomg has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 256 seconds]
Submarine has quit [Remote host closed the connection]
<whitequark>
rand000: reynir: ppx_tools is fixed now
<artagnon>
whitequark: Thanks :)
<whitequark>
artagnon: note that you can't actually run any code with llvm_executionengine right now.
<whitequark>
run_function will assert if you try to pass any arguments at all
<artagnon>
Oh, why is that?
<rand000>
whitequark: super (:
<whitequark>
artagnon: you'll need to expose LLVMAddGlobalMapping and LLVMGetPointerToGlobal
<artagnon>
Okay, I'll do that.
<whitequark>
cast the result of LLVMGetPointerToGlobal to whatever type ctypes uses to represent functions to pointers
<whitequark>
using, uhhh, Obj.magic
<whitequark>
then use ctypes to call it.
<artagnon>
Wait, why is this necessary?
<whitequark>
because you can't run any code otherwise
<whitequark>
there is no API that will let you to.
<artagnon>
How was the old jit running then?
<whitequark>
it used to implement run_function
zpe has joined #ocaml
<artagnon>
So the "normal" run_function requires initialize_native_target first?
<artagnon>
(which is failing currently?)
<whitequark>
no, it simply does not allow you to pass any arguments to the function
<whitequark>
ever
<Drup>
whitequark: llvm define "FIRST_FCMP_PREDICATE = FCMP_FALSE" but I don't see it exposed on the C api, should I do - FCMP_FALSE (considering it's 0) or I don't care ?
<whitequark>
Drup: do it like icmp does it
<Drup>
oh, btw, fcmp_predicate was not exposed in the C side either.
<whitequark>
yes, add it.
<Drup>
yep, that's what I'm doing
zpe has quit [Ping timeout: 255 seconds]
araujo has quit [Quit: Leaving]
araujo has joined #ocaml
jordjordjord has joined #ocaml
<artagnon>
whitequark: Any clue why my ocaml tests won't run?