<virtuoussin13>
lol, from the guide i'm using to the Lua VM:
<virtuoussin13>
"Anyway, most of the time there is little need to seriously scrutinize the header, because since Lua source code is usually available, a chunk can be readily compiled into the native binary chunk format."
* virtuoussin13
punches a baby
<_habnabit>
Yeah, I was confused why you weren't generating lua source
<NaCl>
virtuoussin13: writing a decompiler?
<virtuoussin13>
NaCl: nah, the professor wants to teach his compilers class by having the students write a compiler for a invented scripting language, and have that language target the lua vm
<virtuoussin13>
it falls to me to evaluate how feasible that will be
<_habnabit>
Hahahah
<_habnabit>
What a terrible idea
<NaCl>
haha
<NaCl>
virtuoussin13: a grad student, I presume?
julm has joined #ocaml
<virtuoussin13>
a motivated undergrad actually
<NaCl>
ah. good for you.
<NaCl>
I'd suggest the java VM
<_habnabit>
I was going to say that too
<virtuoussin13>
funny you say that, but he rejected the jvm as being too complex
<virtuoussin13>
and I will say this, the lua vm is dead simple
<NaCl>
but it's arch-dependent?
<virtuoussin13>
yeah, apparently...
<NaCl>
fix the arch to 32 bits
<NaCl>
problem solved.
<virtuoussin13>
hah, screw you students who use 64-bit machines
<NaCl>
they can install 32-bit stuff
Boscop_ has joined #ocaml
<NaCl>
virtuoussin13: the professor could also just provide a skeleton containing a function for grabbing the size of a size_t
<virtuoussin13>
s/the professor/me/
<NaCl>
Oh, right.
Boscop has quit [Ping timeout: 258 seconds]
Boscop__ has joined #ocaml
Boscop_ has quit [Ping timeout: 255 seconds]
everyonemines has joined #ocaml
eikke has quit [Ping timeout: 245 seconds]
struktured has quit [Ping timeout: 244 seconds]
<virtuoussin13>
alright, looks like the only reliable thing I can do is do as you suggest
<virtuoussin13>
thanks guys
<NaCl>
np
Boscop__ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
<virtuoussin13>
can you only use C functions from within ocamlopt code?
<virtuoussin13>
oh, never mind
wishi has quit [Ping timeout: 260 seconds]
Modius has quit [Quit: "Object-oriented design" is an oxymoron]
<virtuoussin13>
actually wait, can you only link in C functions using ocamlopt?
fogus-away has quit [Quit: fogus-away]
wishi has joined #ocaml
<virtuoussin13>
okay, I got it to work. thanks guys for all your help NaCl, that site was just what I needed
<corecode>
is there a way to use C libraries during runtime?
<corecode>
or do i always have to write stub functions?
eikke has quit [Ping timeout: 248 seconds]
<adrien>
that's not something very compatible with compilation
<adrien>
and definitely the opposite of safety
_x711Li has joined #ocaml
x711Li has quit [Ping timeout: 258 seconds]
edwin has joined #ocaml
oriba has quit [Quit: oriba]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
Boscop_ has joined #ocaml
Boscop has quit [Disconnected by services]
Boscop_ is now known as Boscop
Boscop has quit [Changing host]
Boscop has joined #ocaml
<corecode>
adrien: fair. i guess what i ment was a way to access C functions without writing explicit wrappers in C
<adrien>
which C library?
<adrien>
(I don't believe in such tools; I do believe in generation from sufficiently-documented C sources however)
<corecode>
let's say libpulse, because that's what I am interested in right now
<adrien>
what is it?
<corecode>
interface library to pulseaudio
<corecode>
but that doesn't matter for my question
<adrien>
how many functions are there? how many are you interested in?
edwin has quit [Remote host closed the connection]
sebz has quit []
alkoma has joined #ocaml
arubin has quit [Quit: arubin]
arubin has joined #ocaml
pdhborges has quit [Quit: Page closed]
ygrek has quit [Remote host closed the connection]
<corecode>
in there are dozens
<corecode>
interested maybe 5?
<corecode>
but i'm interested in the general principle
<adrien>
the way I see it, you have:
<adrien>
1- fully automated binders: crap API, unsafe API, and I don't believe they can be fully automatic anyway
<adrien>
(they generate a crappy API)
<adrien>
2- hand-made: requires some knowledge of the libraries and the languages; otoh, if you have troubles understanding what's going on, an automatic tool like in 1- would probably fail anyway
<adrien>
quite easy to get a few functions; doesn't take that much time
<adrien>
3- tool to automate the process, with a hand-made base: reuses some of the work from 2- but needs more thinking than 2-; useful for libraries with many functions
<adrien>
I made a tool for 3- and I consider that the only sane way for big libraries
<adrien>
however, it takes some time because you have to make something to handle many more cases
dnolen has joined #ocaml
<corecode>
but it still needs a C stub?
Reaganomicon has joined #ocaml
<adrien>
you need to say how you want to map a C struct to OCaml code
<adrien>
no program will do that properly all the time
* adrien
-> bed
avsm has joined #ocaml
x711Li has joined #ocaml
ztfw has quit [Remote host closed the connection]
_x711Li has quit [Ping timeout: 276 seconds]
Amorphous has quit [Ping timeout: 260 seconds]
Cyanure has quit [Read error: Operation timed out]
Amorphous has joined #ocaml
alkoma has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
preyalone has joined #ocaml
<preyalone>
I'm getting "Line 45 Error: This function is applied to too many arguments; maybe you should use a `;'" https://gist.github.com/1256809
<preyalone>
xlat' is a static key, xlat is a function that treats xlat' as an infinite cycle, returning a portion starting at index i of length len.
<preyalone>
Ah. concat joins a list of lists, not two lists together. My bad, I should use append instead.
preyalone has quit [Ping timeout: 252 seconds]
lopex has quit []
avsm has quit [Quit: Leaving.]
ulfdoz has quit [Ping timeout: 252 seconds]
ulfdoz has joined #ocaml
alkoma has joined #ocaml
alkoma has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]