fusillia has quit [Remote host closed the connection]
madroach has quit [Ping timeout: 244 seconds]
madroach has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
Siphonblast has joined #ocaml
cdidd has joined #ocaml
ontologiae has joined #ocaml
lolcathost has joined #ocaml
hongboz has joined #ocaml
myx has joined #ocaml
lolcathost has quit [Remote host closed the connection]
lolcathost has joined #ocaml
ontologiae has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
lolcathost has quit [Read error: Connection reset by peer]
emmanuelux has quit [Ping timeout: 244 seconds]
snarkyboojum_ is now known as snarkyboojum
Yoric has quit [Ping timeout: 252 seconds]
hongboz has quit [Ping timeout: 264 seconds]
emmanuelux has joined #ocaml
mattrepl has quit [Quit: mattrepl]
emmanuelux has quit [Quit: emmanuelux]
emmanuelux has joined #ocaml
m_m has joined #ocaml
Yoric has joined #ocaml
Snark_ has joined #ocaml
emmanuelux has quit [Quit: emmanuelux]
gour has joined #ocaml
jewel has joined #ocaml
adrien_o1w has joined #ocaml
<gour>
morning
<gour>
adrien: you're working on lablgtk?
adrien_oww has quit [Ping timeout: 245 seconds]
m_m has quit [Read error: Operation timed out]
<adrien>
hi
<adrien>
yes I am
<gour>
i like almost everything i read about ocaml yesterday, but considering we want to write multi-platfrom gui app. i just want to be sure that ocaml/gtk (iow lablgtk) is safe option to count on?
<adrien>
definitely safe for that
<gour>
adrien: thanks
* gour
is happy all interested lists are available via gmane :-)
<gour>
does lablgtk support loading glade interfaces?
<adrien>
yes
<adrien>
not something I've done a lot however
<gour>
i see support for libglade, but not sure if it is still supported or deprecated=
<gour>
?
<adrien>
I think you can load the .glade files directly or translate them to ocaml
<adrien>
well, I don't think it's deprecated in lablgtk but iirc glade is deprecated upstream
<gour>
yeah
<adrien>
but GtkBuilder is probably only good in GTK+3
<gour>
well, we have to get familiar with some basics of ocaml 1st and re-learn some stuff we're familiar with when learning haskell
<gour>
gtk3 is not on the radar soon?
<adrien>
lablgtk's main difficulty is that it uses objects
* adrien
should write a very short high-level intro to lablgtk
<adrien>
well, gtk3 is not that easy: it changes a lot of things; there's work on it but I don't think it's very usable
<gour>
at least, for the basic wrapper, is there some help from introspection?
<adrien>
what do you mean?
<gour>
iirc, many language bindings take help from the gtk's introspection capabilities and generate bindings almost automatically
<adrien>
ah
<adrien>
that's something that's being done for gtk+3 support
<adrien>
I don't think it's a good idea however :P
<adrien>
at least not using the gobject-introspection tools
<gour>
hmm
<adrien>
imho they take good data, make it hard to use, and spit it into a binary file or XML
<gour>
wxpython also uses new method to automate bindings generation by reading doxygen xml interfaces
<adrien>
it's a perfectly valid approach as long as the API of the library has conventions
<adrien>
what I'm saying is that the gobject-introspection tools (as in the files you have in /usr/bin) are awful
<gour>
i never touched it, just somewhat aware of the principle
<gour>
just wonder what is used in e.g. gtkada...
<gour>
..or gtk2hs
<adrien>
I it's buggy because it processes the data instead of exposing it directly
<adrien>
gtkada; I think ada has been designed to be fairly interoperable with C (dedicated types?) so it should be easy even without annotation support
<adrien>
however, without annotations, you lose some type safety
<gour>
yeah, losing type-safety is not good in langs like ocaml/haskell
<adrien>
or maybe it doesn't but then I'm not sure how it manages to do so
<gour>
have you take a look at gtk2hs recently?
<adrien>
no, I haven't but I don't think the difficulty for gtk+3 bindings can be automated
<adrien>
you need to ditch gdk support (or move it elsewhere), make cairo bindings, make them a dependency of lablgtk2, remove lots of API and add new ones
<adrien>
and I wouldn't be surprised there are more such issues lurking
<adrien>
well, binding C++ to python is simpler than to ocaml
<adrien>
and one difference is that you can have bugs which go unnoticed with bindings to python
<adrien>
and that hides gobject-introspection bugs
<adrien>
but ocaml is unforgiving (well, not so much ocaml as the linker which complains about undefined references)
<gour>
so, not much helpers...what about binding other C libs. nothing like c2hs for ocaml (except SWIG)?
<adrien>
there's my "cowboy" tool which can generate nice bindings but it requires work for each class of library (for now there's support for those based on glib)
<adrien>
I don't think making bindings is actually something you can also automate if you want a good API
<adrien>
and sane code
<adrien>
and there are many quirks possible because of C types (how to bind an argument "int*" or "int**"?)
<adrien>
I need to leave a bit, buying bread
<gour>
ok. ta
Yoric has quit [Remote host closed the connection]
Yoric has joined #ocaml
tane has joined #ocaml
<adrien>
back
tane has quit [Quit: Verlassend]
weie_ has joined #ocaml
weie has quit [Ping timeout: 244 seconds]
<gour>
adrien: is you cowboy just for gtk and where it is?
<adrien>
it uses yacfe to parse unprocessed C then it simplifies it (for instance it removes the body of functions) and the last layer is a library-specific backend
<gour>
let me check it out
<adrien>
but this requires some experience with bindings first
<Qrntz>
my best motivation is that some bindings for CL and C# are using it, and if they can, why can't OCaml? :-)
<Qrntz>
I'll have to look GIR up, never heard of it
<adrien>
"gobject-introspection"
<Qrntz>
ah
<Qrntz>
right
<adrien>
it's annoying when you're using git inside a project with "gir" in its name ='(
<adrien>
well, iirc the only thing that can change when binding C++ is that you'll have to extern "C" { ... } your code
<Qrntz>
I never tried GObject introspection, I'm not much of a GTK type and various people have persuaded me that I'll be better to remain that way
* gour
has settled on Fossil dvcs - the best we've found after darcs
<gour>
lol
<gour>
in any case, OCaml language deserves good GUI bindings, imho
<Qrntz>
GIR seems to provide introspection by generating parsable files, right?
<Qrntz>
SMOKE has a dynamic runtime you can query
<Qrntz>
I think I'll still have to generate some .mli files from data provided by SMOKE to ensure type safety, though
<Qrntz>
doesn't seem to be another way
<Qrntz>
s/^/there /
Snark_ is now known as Snark
<gour>
now i wonder why i did not choose ocaml at first place, but started with haskell and chased away some contributors, then had to postpone project for some years, exploring D, then Ada & co. recently :-/
<gour>
by using Ada (Modula-2) or Nimrod we'd have to sacrifice our preference of FP...
mal`` has quit [Remote host closed the connection]
mal`` has joined #ocaml
* gour
is reading tutorials...
watermind has quit [Ping timeout: 260 seconds]
Yoric has quit [Ping timeout: 246 seconds]
hcarty has quit [Ping timeout: 246 seconds]
hcarty has joined #ocaml
hcarty has quit [Ping timeout: 260 seconds]
hcarty has joined #ocaml
<orbitz>
Ada seems quite nice though
<orbitz>
I haven't used it though
<orbitz>
But I think it has a lot of the same higher level goals as the ocaml community
<fasta>
How do I do native builds with oasis?
<gour>
orbitz: yeah, nice language, but with lot of baggage (like C++) and no FP
<adrien>
fasta: CompiledObject: best
<fasta>
adrien: is there also a command line option for that?
<fasta>
adrien: I mean ocaml setup.ml -foo where foo is your answer?
<adrien>
dunno
milosn has quit [Quit: Reconnecting]
milosn has joined #ocaml
myx has quit [Quit: ушёл]
eikke has joined #ocaml
micro_ has quit [Quit: leaving]
<adrien>
RTT's web toplevel is pretty fun but also pretty slow :P
cdidd has quit [Ping timeout: 244 seconds]
micro_ has joined #ocaml
eikke has quit [Ping timeout: 246 seconds]
mye has joined #ocaml
ikaros has joined #ocaml
Yoric has joined #ocaml
eikke has joined #ocaml
eikke has quit [Ping timeout: 246 seconds]
eikke has joined #ocaml
ontologiae has joined #ocaml
eikke has quit [Read error: Operation timed out]
eikke has joined #ocaml
troydm has joined #ocaml
<troydm>
can i have nested types inside type
<troydm>
for example
<troydm>
type a = float
<troydm>
type b = double
<troydm>
type c = a | b
<troydm>
?
<Qrntz>
only through sum types
<Qrntz>
«type c = Float of float | Int of int»
<troydm>
oic
mattrepl has joined #ocaml
ikaros_ has joined #ocaml
ikaros has quit [Ping timeout: 245 seconds]
<fasta>
I get the following message: The recompilation of ocaml-rdf.0.2 failed in /home/fasta/.opam/4.00.1/build/ocaml-rdf.0.2.
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
eikke has quit [Ping timeout: 265 seconds]
wmeyer` has joined #ocaml
<wmeyer`>
hi
<lorilan>
hi
<adrien>
morning
cdidd has joined #ocaml
eni has joined #ocaml
emmanuelux has joined #ocaml
<troydm>
how do i split string in ocaml ?
<lorilan>
Str.split
<troydm>
i don't see any split methods in String
<lorilan>
using regexp
<troydm>
module
<lorilan>
module Str
<troydm>
oic thx
<lorilan>
'welcome
<troydm>
how do i use it?
<troydm>
i need to explicitly import that module?
<troydm>
like i want to use it using Str.split syntax
<troydm>
if i do open Str
<troydm>
it will import all functions from that module
<lorilan>
if you prefer you can do Str.( my code )
<lorilan>
it's like a local open
<lorilan>
otherwise you still can use the Str.my_fun syntax
<troydm>
how do i use it?
<troydm>
i get Str undefined
lorilan has left #ocaml []
lorilan has joined #ocaml
<lorilan>
ha ok
<lorilan>
you have to link during compilation
<lorilan>
-package str with ocamlfind
<lorilan>
or str.cmxa or str.cma if you use ocamlc directly
<troydm>
#load "str.cma";; <- like that
<Qrntz>
yes, that'll work
<fasta>
Is there any library to manipulate paths?
<Qrntz>
there's the Filename module
<fasta>
To get file extensions for example?
<adrien>
Filename
<troydm>
how do i parse double from string ?
<Qrntz>
troydm, float_of_string?
<thizanne>
with Scanf ?
<troydm>
Qrntz: thx
<fasta>
adrien: Filename doesn't contain such a function.
<fasta>
adrien: but Jane Street's version does.
<fasta>
How do I install ocaml-core?
mattrepl has quit [Quit: mattrepl]
<adrien>
if that's the only thing you're after, String.rindex for '.' plus String.sub will be faster
<adrien>
and if you're going to do many file manipulations, ocaml-fileutils will prove helpful
<fasta>
adrien: I would prefer to be able to use ocaml-core too.
<fasta>
Why doesn't opam do a topsort of the dependencies and run everything in parallel?
<troydm>
hmm i've added #load "str.cma" to my source file
<troydm>
and now omake is not compiling it
<troydm>
how should i add that i need str module?
<troydm>
i've tried OCAML_LIBS = str adding in OMakefile
<fasta>
It's just called 'core' and I had to update.
wmeyer` has quit [Ping timeout: 256 seconds]
<Qrntz>
troydm, #load is a toplevel directive, it doesn't work with compiled sources
<Qrntz>
I'm not familiar with OMake so I can't exactly tell you how to make it do what you want
<troydm>
Qrntz: ic, i've used OCAML_OTHER_LIBS = str
<troydm>
and it worked
<Qrntz>
alright then
<troydm>
also i'm not sure if it's righ way to do that
<fasta>
When using core, I get: ocamlfind: Error from package `threads': Missing -thread or -vmthread switch
<fasta>
Can libraries change behaviour on what compiler switch was specified?>
<adrien>
no
<adrien>
different modules might be linked in however
<fasta>
I am using oasis, but I have no idea what it wants me to do, however.
<fasta>
Is there any oasis based package dependent on core such that I can see how they run it?
<fasta>
I want to use Filename, but Core.Filename doesn't exist and neither does Filename?
<fasta>
Do I have to do something special to use the core library?
<fasta>
They say it's an overlay, which seems to suggest that it replaces the original core library.
pango_ has joined #ocaml
pango has quit [Ping timeout: 244 seconds]
<fasta>
I can do open Core.Avltree;;, but I cannot do open Core.Filename;; ...
<adrien>
ocaml creates a smallish asm stub and then calls the linker for all the files it has
emmanuelux has quit [Quit: emmanuelux]
<adrien>
it does almost nothing
jewel has joined #ocaml
<adrien>
one possibility actually would be that it determines which symbols are not needed and then creates corresponding linking instructions to leave them out
<adrien>
that sounds doable but I bet it's definitely not portable
jewel has quit [Ping timeout: 260 seconds]
emmanuelux has joined #ocaml
<fasta>
adrien: what's not portable about it?
<fasta>
adrien: why does it call gcc and not the actual linker?
<fasta>
adrien: oh, never mind.
<adrien>
you should always invoke GCC rather than the ld directly because it will set some parameters and is easier to use
<adrien>
as for portability, I guess such scripts would be limited to gnu binutils
<fasta>
adrien: does ghc also call gcc?
<adrien>
I hadn't thought about that before so I'll probably give it a try
<adrien>
dunno about ghc
hongboz has joined #ocaml
<troydm>
is there a mutable array format in caml suitable for storing large array of 2 dimension double values dat can be randomly modified
<troydm>
Buffer seems not suitable for this task
<Qrntz>
troydm, look into the Bigarray library
<Qrntz>
why would Buffer be? it's string-based
<troydm>
Qrntz: can i modify a value in Bigarray randomly?