rwmjones has quit [Read error: Operation timed out]
Zeev has joined #ocaml
rwmjones has joined #ocaml
<Zeev>
Hi all. Is there an example on the web on how to call windows dll from ocaml? I want to make my f# dll independent on .net, I saw this one for haskell: http://stackoverflow.com/a/1028417/1227804, can't find something relevant in ocaml, digging in haskell for now
<Zeev>
f# app*
mcclurmc has joined #ocaml
mort___ has joined #ocaml
<adrien_oww>
which function are you interested in?
<flux>
kakadu, (also, self-constructed dynamic strings are the whole reason for those sql injection vulnerabilities)
<adrien_oww>
Zeev: you can try to build this project; I hope it'll work and that it'll match what mingw-w64 offers
<adrien_oww>
because years ago, mingw.org didn't provide enough API functions to make this work OOTB
<flux>
kakadu, also2, are you certain you want to retrieve tuples as the response?
<flux>
kakadu, usually you would do the response like: select id, descr, maxexp from ..
<flux>
doing it like that returns rows that have a single three-tuple
<flux>
(which probably is a postgresql extension)
<gasche>
that looks like a reasonable usage case for Macaque
<Kakadu>
gasche: Is it possible to do this with current version of macaque?
<gasche>
adrien_oww, Zeev: once we get information on this precise problem, can you write it down somewhere (mail to caml-list, blog post, whatever) so that other people with the same question can find a structured answer?
<gasche>
Kakadu: you cannot turn arbitrary text into a WHERE-condition
<gasche>
but you can build rather arbitrary WHERE-conditions as well-typed pieces of queries
<adrien_oww>
gasche: good idea; I have to admit I wasn't even sure to find this again
<adrien_oww>
gasche: I should also try to build with mingw-w64; last time I tried ocaml-win32 was really long ago (4 or 5 years at least...)
<flux>
gasche, as far as I can see his problem did not require that..
* adrien_oww
-> Essen
<Kakadu>
flux: next line gives the same error
<Kakadu>
let s text = PSQL(dbh) "select id,descr,maxexp from skills where to_tsvector(descr) @@ to_tsquery($text)"
<Kakadu>
gasche: Are u talking about my current SQL query or about macaque?
<gasche>
Macaque
<flux>
kakadu, gives the same error about a constructor?
<flux>
kakadu, and you're certainly using the language extension to compile that file?
<gasche>
hm
<gasche>
seems I overlooked what the to_tsquery part is trying to do
<Kakadu>
I lloked at macaque readme and have not seen any mentions about text searcgh
<flux>
macaque seems interesting in that it has still been developed (in december)
<flux>
kakadu, if you type 'psql' do you get a connection?
<flux>
because I don't see a directive telling the database connection stuff
<flux>
the part you have in the do_search function
<flux>
that's for runtime, not for compile-time
<ygrek>
Kakadu, obviously the camlp4 extension tries to connect somewhere
tane has joined #ocaml
<ygrek>
looks like very evil extension
<ygrek>
trying to eavesdrop on you!
<Drup>
pgsql check the coherence between queries and the database at compile time
<ygrek>
get rid of it immediately, report to antivirus companies and format your drive
<Drup>
pgocaml
<Drup>
*
<ygrek>
ocaml raises malware bar at the new level - eavesdropping at compile time!
<flux>
next step: infiltrate typerex?
beckerb has joined #ocaml
zpe has joined #ocaml
<ygrek>
flux, I guess it already does so!
<ygrek>
have you seen "don't be evil" anywhere at ocamlpro site? They don't even dare to claim that!
<flux>
but pgsql is pretty nice (once you get it working)
<flux>
but it has some problems. you would need a macro-system to accompany it
<flux>
otherwise there's no way to share fragments between queries
<flux>
and then another problem is that the array support leaks some server resources
<flux>
and the third one is that sometimes it doesn't understand what is 'a option and what is 'a
<flux>
maybe those could be fixed!
<ygrek>
sounds too complex for me
<flux>
the first one could be fixed with any general macro system evaluated before that extension, the second one might be trickier, the third one I don't know about - maybe explicit annotations
<Drup>
flux: you're talking about macaque, aren't you ? :)
<flux>
no, I'm talking about pgsql ;), but yeah I should take a new look to macaque..
<flux>
last time I looked at it it was nowhere near production-use for me at least
<flux>
does it still do aggreagations? at least with pgsql you get access to all postgresql goodness such as procedures (with types inferred automatically), window functions, lateral joins, etc etc..
<Drup>
oh, it's absolutly not production-use at all, it lacks most of sql operators, but you have composability
<ygrek>
sqlgg rules both out of the water in no time
zpe has quit [Ping timeout: 264 seconds]
mort___ has quit [Quit: Leaving.]
<flux>
depdendency on "menhir" sugests it doesn't support all those niceties either ;)
<flux>
but thanks, I'll git clone that as well for later perusal!
<ygrek>
flux, it supports sqlite and mysql --> 1:0
eikke has joined #ocaml
<ygrek>
and it doesn't eavesdrop at compile-time --> 2:0
<Drup>
sqlgg doesn't have the same goal at all, you generate code by giving sql. macaque and pgocaml are the exact opposite ...
<flux>
I see it doesn't come with mli-files -> 2:1
<ygrek>
Drup, oh thanks, that counts --> 3:0
<ygrek>
flux, yes, but that counts other way round - less clutter to read through!
<Drup>
euh, no, the whole point is to NOT write sql !
<Drup>
(and to type it statically)
<ygrek>
Drup, if you think sql is all bad - you've got it all wrong, man
<flux>
sql is pretty nice
<flux>
you just write english sentences and values come out! how brilliant!
<ygrek>
flux, any english sentence!
<Drup>
x)
hkBst has quit [Ping timeout: 256 seconds]
<ygrek>
and sql gurus write elfish and it works too!
<gasche>
ousado: that said, you shouldn't need to patch OCaml itself to use Jun's compiler-libs-hack
<gasche>
so I'm not sure why you need this script at all
<ousado>
gasche: well, the issue is that the sources are not available anymore, as far as I can see
<ousado>
and I wanted to test building that vanilla compiler
<ousado>
from his description, I need main.ml for that
<ousado>
oh.. my opam "system" compiler is a local one already
<ousado>
so I actually don't need it, but it's still good to know/have
<gasche>
which sources are you talking about?
<ousado>
the ocaml compiler sources
<gasche>
then I'm not sure what you mean by "not available"
<ousado>
oh, opam puts them into the ./opam/build
<ousado>
.. directory
<ousado>
I assumed it removes the build directory, as it does with packages
<ousado>
per default
<gasche>
if you want to build some additional tools, you may need to play a bit with a build directory, indeed
<gasche>
(have you written about the example of metaprograms you have in mind yet?)
<ousado>
not yet
zpe has joined #ocaml
<ousado>
I'll need some time to collect my use-cases, check the terminology etc.
<ousado>
there seem to be very different terms for similar things in various languages
<gasche>
don't be too perfectionist
<gasche>
just Haxe code examples with explanation of the intended behavior would be fine as far as I'm concerned
<gasche>
but of course you're free to make it as general and interesting as you can :p
<ollehar>
I actually get a seg fault from my ocaml app :(
<ollehar>
running on shared host, webserver
<ousado>
yes, you're right, I shouldn't get too formal. but OTOH I'd like to know myself what people are talking about when they use terms like nested quotation/anti-quotation/quasiquotation in haskell/ocaml vs reified macros in haxe, scala etc.
<ousado>
ollehar: which server is that?
<ollehar>
lib/libc.so.6 version `GLIBC_2.15' not found
<ollehar>
ousado: ubuntu
zpe has quit [Ping timeout: 256 seconds]
<ollehar>
I then copied my own private libc to /home/ollehar/lib, exported LD_LIBRARY_PATH, and then seg fault
<ollehar>
could it be that my libc doesn't rhyme well with the rest of the shared host system?
<ollehar>
or it could be liblua5.1...
<ollehar>
or libpcre
<ollehar>
sigh
<Drup>
ousado: the concept betwen quotation is actually very simple
<Drup>
behind* x)
<ollehar>
lol, get seg fault when using ls too
<ollehar>
not ocaml dependent
mort___ has quit [Quit: Leaving.]
talzeus has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
Zeev has quit [Disconnected by services]
wagle has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
wagle has joined #ocaml
beckerb has joined #ocaml
<ousado>
Drup: yes, that's the problem with terminology, it's often more complex (as in ambiguous, context-dependent) than the concepts behind it
<ousado>
people like to invent new terms for existing things, or reuse existing terms for different ones
<ousado>
s/ones/things
bitbckt has quit [Ping timeout: 260 seconds]
ontologiae has quit [Ping timeout: 248 seconds]
<Drup>
ousado: basically, a client value in eliom is a quotation and % is a generalized splicing operator (that do also anti-quotation, because %({{ x }}) ~= x)
<Drup>
and you almost know all of it
zpe has quit [Ping timeout: 240 seconds]
Neros has quit [Remote host closed the connection]
Neros has joined #ocaml
ontologiae has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
Drup has quit [Ping timeout: 276 seconds]
Drup has joined #ocaml
<ousado>
Drup: it looks like I explained the 'problem' I have insufficiently. It's not that I don't know what these things are in general (I mean there's plenty of resources to look them up) but there are both smaller and more significant differences between what people refer to, depending on whether they talk about reified macros in haxe, quasi-quotation in template haskell, camlp4, fan, etc. (see the discussion here: http://hongboz.wordpress.com/2013/02/05/
<ousado>
syntactic-meta-programming-in-ocaml-ii-5/ ). So if I come here and ask "Does ocaml has macros?" or even 'reified macros' that's an almost meaningless question, because I still have to explain in detail what I mean. Which is why I like to define terms somehow to ease further communication.
<ousado>
woops
<ousado>
that was long
zpe has joined #ocaml
beckerb has quit [Quit: Konversation terminated!]
zpe has quit [Ping timeout: 252 seconds]
mort___ has joined #ocaml
beckerb has joined #ocaml
osnr has joined #ocaml
osnr has quit [Changing host]
osnr has joined #ocaml
_andre has quit [Quit: leaving]
osnr has quit [Ping timeout: 245 seconds]
Drup has quit [Quit: Leaving.]
Drup1 has joined #ocaml
Kakadu has quit [Read error: Connection reset by peer]
_andre has joined #ocaml
tane has quit [Quit: Verlassend]
<rixed>
batteries people: don't we want singleton for BatList and BatArray like we have for most containers?
<Drup1>
ousado: ok, I understand what you mean
Drup1 is now known as Drup
zpe has joined #ocaml
<gasche>
rixed: it doesn't make much sense for BatArray, you're welcome to do it for uniformity's sake
Drup has quit [Ping timeout: 248 seconds]
_andre has quit [Quit: leaving]
ygrek has joined #ocaml
_andre has joined #ocaml
<rixed>
gasche: I often need such trivial functions which make no sense out of context. Probably a bad smell :)
zpe has quit [Ping timeout: 240 seconds]
<rixed>
gasche: what's the purpose of the "let map = map" in batArray.ml ?
<flux>
it introduces a symbol from the module it has opened
<flux>
like: module MyPrintf = struct open Printf let printf = printf end
<ygrek>
flux, actually that specific example is not useful :)
<rixed>
gasche: Ok, not more sense since Array is now included (not just opened). I'm afraid git blame me for the include :/
<gasche>
rixed: no tests ? :'(
<rixed>
flux: except it's: module MyPrintf = struct include Printf let printf = printf end :-)
<rixed>
gasche: seriously, for singleton?
<gasche>
half-seriously
<rixed>
hmmm... Ok,. will to it with the test generator, just to unrust my qtest :)
<gasche>
think of, for example, code coverage metrics
<rixed>
s/unrust/stretch/
<gasche>
we have been using Bisect on Batteries a few months ago
<gasche>
we're far from 100% anyway
<gasche>
but *if* we were, singletons with no tests would move from green to red
<gasche>
and that would be bad, right?
<gasche>
(I'm not quite sure 100% coverage is actually an important goal, but I still think it's better to have more tests than less)
<gasche>
rixed: besides, I'm thinking about working on this BatString.nreplace thing
<gasche>
that would actually be a very bad idea given the workload I already have, but for some reason I would feel bad not doing it
ollehar has joined #ocaml
<gasche>
ollehar: do you have any idea whether it's possible to call winapi functions from OCaml compiled with mingw-64?
<gasche>
someone asked that a few hours ago and adrien_oww was unsure about it
<gasche>
I'm thinking you may be the second person qualified to help answer that
<rixed>
gasche: hopefully you'll prove me wrong with a nreplace that's both simple and fast as Glyn's one is ;)
<gasche>
chan: what should we submit on reddit today?
<ollehar>
gasche: thanks for your confidence :) No idea, though :P
hkBst_ has quit [Ping timeout: 256 seconds]
<gasche>
I'm hoping Windows people around here will have their curiosity piqued by this question, provide a clear answer, and then we can write it down somewhere for when someone ask it again
hkBst_ has joined #ocaml
<adrien_oww>
well it's definitely possible
<adrien_oww>
the issue was that the API coverage of mingw.org was fairly bad
<adrien_oww>
so you had to skip quite a lot of functions
<adrien_oww>
and ocaml-win32 was developped for MSVC
<gasche>
to be frank, the only reason I care about mingw vs. something else is that, iirc., that's what is used by Jonathan's Windows installer
<adrien_oww>
I cannot care about MSVC since I can't do shit with it because of its EULA; iirc it's completly ridiculous, even worse than most others
talzeus has joined #ocaml
<gasche>
what do you mean?
<ousado>
I've built hax with mingw64 recently
<ousado>
*haxe
<adrien_oww>
gasche: I can't find the license easily but it's the kind of thing that I cannot use simply for the fact that even though the command-line stuff is freely downloadable from microsoft.com, you can't redistribute it
<ousado>
IIRC, the resulting executable is independent of any cygwin/whatever stuff
<adrien_oww>
and that's only one of the many annoyances of the licenses as you can guess
zpe has joined #ocaml
<gasche>
ok
<adrien_oww>
and you cannot build from linux with MSVC :P
mort___ has quit [Quit: Leaving.]
<gasche>
that maybe wouldn't be a problem for an end-user OCaml install script, but I'm sure Jonathan had reasons for not using it as well
<adrien_oww>
anyway, back to the original issue: mingw-w64 is a much more active project with a much better API coverage(*) so the bindings should be buildable
<adrien_oww>
(*) mingw.org's API coverage stopped at windows 9x; mingw-w64 compatibility starts at windows 2k
chrisdotcode has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
smondet has joined #ocaml
hkBst__ has joined #ocaml
hkBst_ has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
hkBst__ has quit [Excess Flood]
hkBst__ has joined #ocaml
<ollehar>
can I in some way pass this gcc switch to ocamlopt?