<Drup>
yeah, AST manipulating code is not the most elegant ever
<xenocons>
could be worse
<xenocons>
is that autogenerated?
<whitequark>
no, I just wrote that by hand
<xenocons>
most impressive
<whitequark>
and I cannot describe with words how pissed off I am about that fact
<xenocons>
ha
<xenocons>
writing code you dont like sounds realistic
<Drup>
we may need quasi quotation at some point :>
<whitequark>
I'm ambivalent to the code. I hate the fact that I spent at least two hours on this crap
<whitequark>
actually 3.5 at this point
<whitequark>
I could have done something enjoyable, but noooo
* whitequark
grumbles
<Drup>
you could probably make it a lot cleaner with some auxiliary functions
maattdd has quit [Ping timeout: 252 seconds]
<whitequark>
harder to modify though
<Drup>
also, don't use "mknoloc"
<whitequark>
hm?
<Drup>
for your function "lid"
<Drup>
use the same technique as in ast_helper : an optionnal argument that use default_loc
<Drup>
so that the lid will have a location, if there is an error
<whitequark>
right
studybot_ has quit [Remote host closed the connection]
<xenocons>
whats ocaml+emacs integration like?
shinnya has quit [Ping timeout: 255 seconds]
studybot_ has joined #ocaml
<Drup>
xenocons: look up merlin
<xenocons>
k
shinnya has joined #ocaml
nikki93 has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
maattdd has joined #ocaml
studybot_ has quit [Ping timeout: 264 seconds]
studybo__ has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
studybo__ has quit [Remote host closed the connection]
WraithM has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
<tautologico>
is typerex still active?
<whitequark>
Drup: what would you use, [@encoding bits32] or [@encoding "bits32"] ?
<whitequark>
or even [@encoding Bits32]
<Drup>
first or third
<whitequark>
I like third, it suggests an enumeration (which it actually is)
<Drup>
probably with a real type/identifier defined in your library :)
Rotacidni has joined #ocaml
<whitequark>
although, it maps to a user-defined function
<whitequark>
errr user-visible
<whitequark>
so probably first
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
WraithM has quit [Remote host closed the connection]
WraithM has joined #ocaml
rgrinberg has joined #ocaml
IbnFirnas has quit [Ping timeout: 246 seconds]
IbnFirnas has joined #ocaml
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
maattdd has joined #ocaml
WraithM has quit [Read error: Operation timed out]
_obad_2_ has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Read error: Connection reset by peer]
maattdd has quit [Ping timeout: 252 seconds]
_obad_2_ has joined #ocaml
rgrinberg has joined #ocaml
nikki93 has joined #ocaml
WraithM has joined #ocaml
dotfelix has joined #ocaml
fantasticsid has joined #ocaml
dotfelix has quit [Quit: Leaving...]
wmealing1 has joined #ocaml
<wmealing1>
i got some meta questions about the language/setup that may take a few minutes to answer.. is this a sane place for that ?
nikki93 has quit [Remote host closed the connection]
<whitequark>
yes
jpdeplaix has quit [Ping timeout: 245 seconds]
nikki93 has joined #ocaml
divyanshu has joined #ocaml
wmealing1 has quit [Quit: Leaving.]
jpdeplaix has joined #ocaml
ThatTreeOverTher has quit [Remote host closed the connection]
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 252 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
shinnya has quit [Ping timeout: 240 seconds]
araujo has quit [Quit: Leaving]
divyanshu has joined #ocaml
WraithM has quit [Ping timeout: 240 seconds]
divyanshu has quit [Quit: Computer has gone to sleep.]
WraithM has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
maattdd has joined #ocaml
rgrinberg1 has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
maattdd has quit [Ping timeout: 252 seconds]
divyanshu has joined #ocaml
rwmjones has quit [Ping timeout: 252 seconds]
rwmjones has joined #ocaml
castorks has quit [Ping timeout: 240 seconds]
castorks has joined #ocaml
siddharthv_away is now known as siddharthv
<IbnFirnas>
puzz
siddharthv has quit [Remote host closed the connection]
<xenocons>
i found out that thing that was pulling errors in to my vim for ocaml
<xenocons>
syntastic
<tautologico>
how can I see what flags the oasis generated setup.ml is passing to ocamlopt?
axiles has joined #ocaml
siddharthv has joined #ocaml
angerman has joined #ocaml
<whitequark>
tautologico: try passing -classic-display to ocamlbuild
maattdd has joined #ocaml
<whitequark>
what does [< `A|`B > `X `Y] mean? specifically the `X `Y part
maattdd has quit [Ping timeout: 252 seconds]
ygrek has joined #ocaml
siddharthv is now known as siddharthv_away
<adrien>
whitequark: I knew I was looking at the wrong ocaml-sodium but I thought most things would apply anyway; and many still do
<adrien>
the creation of the .so is weird, no cmxs support, unconditional creation of cmxa even for platforms without native code support
<adrien>
if there were additional files to install, there would be a need to support $(DESTDIR)
<adrien>
and it requires a posix environment which is almost not the case for oasis/ocamlbuild (I really hope to get that bug fixed)
<adrien>
I understand the appeal of not using oasis
<adrien>
I don't believe it saves work overall
<adrien>
and considering all my troubles of cross-compiling oasis-based libraries on saturday were either because of old versions of oasis (more than one year and the only thing missing was the use of "ocamlfind ocamlmklib" instead of "ocamlmklib") or because of additions after OASIS_STOP, I cannot complain
racycle has quit [Quit: ZZZzzz…]
<tautologico>
I only wish things like oasis and ounit were on github
nikki93 has quit [Remote host closed the connection]
<wmealing1>
so, i'm thinking of using emacs, with some kind of repl at the bottom
<wmealing1>
i also like writing out some basic tests.. with functionality as i go
<wmealing1>
as i'm very new at ocaml, is this something a newbie can expect to do ?
clan has quit [Quit: clan]
nikki93 has joined #ocaml
jo` has joined #ocaml
rand000 has joined #ocaml
studybot_ has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
studybot_ has quit [Remote host closed the connection]
studybot_ has joined #ocaml
Thooms has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
ikaros has joined #ocaml
skchrko has joined #ocaml
studybo__ has joined #ocaml
studybot_ has quit [Read error: Connection reset by peer]
<companion_cube>
elfring: low, imho, most people don't use OO
<companion_cube>
wmealing1: yes you can! emacs has tuareg (I think) for the the repl part
<companion_cube>
for handling OCaml in general
<companion_cube>
and there is oUnit for unit testing
struktured has quit [Ping timeout: 264 seconds]
<xenocons>
ounits great
Kakadu has joined #ocaml
jao has quit [Ping timeout: 240 seconds]
studybo__ has quit [Read error: Connection reset by peer]
zarul has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
<wmealing1>
ok
<wmealing1>
i'll try to set itup, you'll hear my complain i'm sure
<wmealing1>
;)
<companion_cube>
:)
marr has joined #ocaml
clan has joined #ocaml
zarul has joined #ocaml
zarul has quit [Changing host]
zarul has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
<elfring>
companion_cube: Would you like to help in a better understanding for optional parameters in OCaml functions?
<companion_cube>
elfring: sure, what's the problem?
<companion_cube>
when you write let f ?(x=0) y = ..... x is an optional parameter
<Kakadu>
companion_cube: I bet syntax f ?x () is not obvious
<Kakadu>
at least it was naot obvious to me how it works
<companion_cube>
I understand
<companion_cube>
that's not really a beginner's feature
<Kakadu>
syntax let f ?(x=0) () is much siplier because it is almost C
<Kakadu>
or maybe C++
ygrek has joined #ocaml
* Kakadu
doesn't remember for sure from what standart C supports ad-hoc polymorphism
<elfring>
Is it needed to order optional parameters? Do you place them after the required ones in the function declaration?
<companion_cube>
Kakadu: you mean the kind of macro switch?
<companion_cube>
elfring: the order doesn't matter, but you should have at least one non-optional parameter after them
<companion_cube>
let f ?(x=0) ?(y="foo") z = ....
<companion_cube>
the reason is knowing when a function is partially applied or not
<Kakadu>
companion_cube: No, I didn't thought about any macros
<companion_cube>
Kakadu: hmmmmm, which kind of polymorphism are you thinking of then?
cdidd has quit [Ping timeout: 240 seconds]
<Kakadu>
int f (int); int f(int,int)
<elfring>
Why do you prefer "one non-optional parameter after them"?
<companion_cube>
Kakadu: are you sure this is allowed in C?
<companion_cube>
elfring: because if you have let f ?(x=0) = x+1
<companion_cube>
then how do you make a distinction between f and f applied to the optional parameter 0 ?
<companion_cube>
in this case you always have to apply explicitely f to x
<companion_cube>
f ?x:NOne
<companion_cube>
or f ~x:42
<companion_cube>
so the parameter isn't that optional...
<Kakadu>
companion_cube: Yeah, wrong example
araujo has joined #ocaml
araujo has quit [Changing host]
araujo has joined #ocaml
<Kakadu>
companion_cube: No, example is OK
<Kakadu>
You can't have void foo(int x) together with void foo(int x, int y)
<Kakadu>
or void foo(char* s) with void foo(int x)
<companion_cube>
I never saw anything like this in C
<companion_cube>
only in C++
<elfring>
I am used to specify optional parameters after the required ones from my C++ development experience. Does OCaml really prefer the opposite direction?
<companion_cube>
C++ and Ocaml are really different
cdidd has joined #ocaml
avsm has joined #ocaml
<elfring>
I find it strange that the preferred ordering of optional parameters is not explicitly mentioned in the documentation. (A few source code examples seem to indicate such an implementation detail.)
<companion_cube>
I'll submit an issue about this
zpe has joined #ocaml
<adrien_oww>
elfring: labelled arguments came before optional ones and their goal was to be able to reorder arguments at will
<companion_cube>
elfring: it does actually mention it (at the section "warning: this optional argument cannot be erased")
maattdd has joined #ocaml
eizo has joined #ocaml
Thooms has quit [Quit: WeeChat 0.3.8]
nikki93 has quit [Remote host closed the connection]
<elfring>
companion_cube: What do you mean with an issue submission?
<companion_cube>
ocaml.org is on github, you can submit tickets/issues
<companion_cube>
but actually the point here is dealt with properly
<flux>
I think there's a small chance of actually writing code that fails to function as intended, thanks to that warning :)
<flux>
similarly for C++, but there it's an error to have default-value arguments before non-defaults :)
<flux>
in both cases it's because it's impossible to express the other case
<adrien_oww>
it's hopefully fairly easy to catch
<companion_cube>
well you can write f ?x:None to specify that x isn't provided
jonludlam has joined #ocaml
<companion_cube>
but that's really cumbersome
<flux>
I think it's indeed fairly safe to say that OCaml and C++ are completely different languages :)
<flux>
companion_cube, well, it's not really optional then, is it..
<flux>
OCaml is also AFAIK the only ML-family language with optional, or even labeled, arguments
<flux>
so it's difficult to draw examples from other languages on that
<elfring>
I am not completely convinced so far. Will it help to clarify the documentation about parameter ordering?
<companion_cube>
elfring: well it explains *why* the C++ parameter ordering won't work in OCaml
<companion_cube>
so if you read it you'll understand
<flux>
if the documentation mention that optional arguments must be followed by a regular argument, and why this is the case, then that should be fixed
<flux>
oops
<flux>
I mean to say 'doesn't mention'
arj has joined #ocaml
<elfring>
I do not see the explicit explanation from the OCaml documentation for a different parameter ordering so far.
<flux>
I suppose 'must not' is a heavy expression, as they don't really MUST be, but they are quite not as useful otherwise :)
<companion_cube>
maybe the documentation could mention that it is better to have a non-optional parameter after
<elfring>
Will such an implementation detail become "official"?
<companion_cube>
what do you mean by 'official' ?
<flux>
elfring, there's really no other sensible semantics that's been suggested..
<elfring>
flux: Can you really extract from this grammar description that optional parameters should be specified before required ones?
<companion_cube>
it's not that clear-cut
<flux>
"If a non-labeled argument is passed, and its corresponding parameter is preceded by one or several optional parameters, then these parameters are defaulted, i.e. the value None will be passed for them."
<companion_cube>
the only real requirement is that there should be at least one non-optional parameter after optional ones
<companion_cube>
but there can also be non-opt parameters before
<flux>
in other words, the parameters after the non-labeled argument are not defaulted
<flux>
"All other missing parameters (without corresponding argument), both optional and non-optional, will be kept, and the result of the function will still be a function of these missing parameters to the body of f."
jo` has quit [Ping timeout: 240 seconds]
<flux>
so let's say let foo () ?a ()
<flux>
or actually, let foo ?a () ?b () = ()
<flux>
if I say foo, well then it's obviously the same function, if I say foo (), it applies a to its default value (None), and becomes val foo : ?b -> unit -> unit
<flux>
or if we have let foo2 () ?a = ()
<flux>
if we say foo2 (), following those rules 'a' is not applied
<flux>
therefore the resulting type if val foo2 : ?a : _ -> unit
<flux>
so if that's ok for you, then fine :)
<flux>
but typically people don't want that
<flux>
it's like how C++ has features people usually avoid, even if they are 100% standards-compliant
<flux>
such as object splicing
ontologiae has joined #ocaml
<elfring>
Do you prefer the following interface
<elfring>
let rec find2 ?comparison:(cmp=Pervasives.compare) ?when_not_found:(not_found_action=not_found_default_action) x = function ...
<elfring>
over this one?
<elfring>
let rec find2 x ?comparison:(cmp=Pervasives.compare) ?when_not_found:(not_found_action=not_found_default_action) = function ...
ollehar1 has joined #ocaml
Nuki has joined #ocaml
<companion_cube>
elfring: yes
<companion_cube>
but I'm not sure your syntax is correct
<companion_cube>
it should be like let rec find2 x ?(comparison=Pervasives.compare) ....
mort___ has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
<flux>
I think you are just jusing a shortcut
<flux>
he has separated label name and the variable name
<elfring>
Do labelled parameters support aliases?
<flux>
aliases?
<flux>
multiple names for the same argument?
<companion_cube>
flux: oh
<companion_cube>
didn't know that
<elfring>
flux: Can a labelled parameter specify an alternative name for the use in the corresponding function implementation?
<flux>
elfring, you just did..
<flux>
the name is 'cmp' for the variable
<flux>
and 'comparison' for the label
<flux>
it's not an alias per se
<flux>
but a variable name for the labeled argument; by default the variable name is the same as the argument name
<elfring>
flux: Thanks for your feedback. I was not really sure which are the correct terms for OCaml in this use case.
<flux>
so your signature would look like val find2 : ?comparison : ('a -> 'a -> bool) -> ?when_not_found : (unit -> 'a) (* <- I'm guessing here *) -> 'a -> 'a = ..
<flux>
btw, usually people would have two functions that could be used in conjunction like: default "Default value" (find_opt ~comparions:(...) "value") .. instead of baking the handling of not-found inside the function
<flux>
but that's just an idea, this works as well :)
Nuki has quit [Remote host closed the connection]
<elfring>
flux: I am "playing around" for a class library extension. I imagine that it will be useful to make the handling of the case "something was not found" configurable by a passed function.
cdidd has quit [Remote host closed the connection]
nikki93 has joined #ocaml
dsheets has quit [Ping timeout: 255 seconds]
nikki93 has quit [Ping timeout: 252 seconds]
Anarchos has joined #ocaml
studybot_ has joined #ocaml
ygrek has quit [Ping timeout: 276 seconds]
ggole has joined #ocaml
avsm has quit [Quit: Leaving.]
clan has quit [Quit: clan]
skchrko has quit [Ping timeout: 252 seconds]
_andre has joined #ocaml
avsm has joined #ocaml
dsheets has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<companion_cube>
elfring: the usual behavior in this case is either: 1/ raise an exception 2/ return an option
skchrko has joined #ocaml
AltGr has joined #ocaml
shinnya has quit [Ping timeout: 265 seconds]
rand000 has quit [Ping timeout: 252 seconds]
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
<ggole>
"Can you change the value of 1?" wow, some people sure are confused
<ggole>
You used to be able to assign to True and False in Python, so maybe that isn't as unreasonable as it seems.
<adrien_oww>
ggole: you can change the value of "true" and "false"
<adrien_oww>
in ocaml
<xenocons>
haha
<Drup>
but, as opposed to python, it's scoped :)
<xenocons>
ggole: reading /r/python, doomed to the comments
<adrien_oww>
# string_of_bool false;;
<adrien_oww>
- : string = "NEIN!"
<adrien_oww>
clearly, ocaml is multilingual
<adrien_oww>
(I didn't redefine string_of_bool)
<pippijn>
you modified the result
<adrien_oww>
I'm not a politician!
<pippijn>
# string_of_bool true;;
<pippijn>
- : string = "KLAR"
<adrien_oww>
:)
wmealing1 has quit [Quit: Leaving.]
<pippijn>
# string_of_bool true;;
<pippijn>
- : string = "ofc."
ggole has quit [Ping timeout: 265 seconds]
ggole has joined #ocaml
<ggole>
Think I missed some chat there
<ggole>
Stupid internets.
rand000 has joined #ocaml
maattdd has quit [Ping timeout: 276 seconds]
castorks has quit [Quit: leaving]
rks` has joined #ocaml
wmealing1 has joined #ocaml
<whitequark>
adrien_oww: the creation of .so is very much intended
<whitequark>
it's a side effect of how ctypes interacts with toplevel. you need an empty .so linked with -lsodium
<whitequark>
OASIS, on the contrary, requires an empty ctypes_stubs.c
Thooms has joined #ocaml
<adrien_oww>
ah, ok
wmealing1 has quit [Quit: Leaving.]
<whitequark>
Drup: I realized I really want a proper deriving
<whitequark>
where by "proper" I mean without the weird <t> stuff and module madness. just make it a function per type...
<Drup>
whitequark: it's already a function per type
fantasticsid has quit [Ping timeout: 240 seconds]
<Drup>
whitequark: Foo.show<t> is shortcut for Foo_t.show
* whitequark
would really prefer Foo.show_t, as it maps to what he'd usually write by hand
<Drup>
well, for show, there is only one function
<Drup>
it's not always the case
<whitequark>
hm
<Drup>
and it's easier to derive a module per type, in term of scope management
<whitequark>
maybe you have a point
<Drup>
(I don't want to know how you fit everything in the same module for multiple types :D)
<whitequark>
simple, prefixing method name with type name
<Drup>
and ?
<whitequark>
what "and"? that's all
<Drup>
you will overide the show module
<Drup>
if you have different types
<Drup>
or you will have to have something of a global transformation, and that's a No, with a capital letter.
<whitequark>
type t = int [@@deriving (show)] type u = string [@@deriving (show)] → val show_t : t -> string val show_u : u -> string
<Drup>
oh
<Drup>
so no module
<Drup>
ok
<whitequark>
or t_to_string, something along these lines
<Drup>
yeah, I prefer to fit them into a module, it's cleaner
<whitequark>
so much more verbose :/
<flux>
I kinda like whitequark's suggestion, it makes less of a mess?
<flux>
just looks clean in the exported interface as well
<whitequark>
what flux says.
<whitequark>
it really makes the interface the same as you'd write by hand, without it being clearly deriving-specific
<whitequark>
and that's a Good Thing imo, because it allows one to freely go from one to another
<Drup>
huum, ok
<Drup>
yeah, it makes sense
<Drup>
(I though you wanted to have everything in one big module Show)
<whitequark>
oh. no :D
<flux>
not until we have open modules :)
<flux>
(I suppose, namespacing..)
<whitequark>
that sounds like it wouldn't work with separate compilation
<Drup>
exactly
<flux>
insert more magic
<flux>
it can be made to work!
<whitequark>
please, no more magic. I've had enough in ruby
<Drup>
whitequark: I would put an option to keep the scoped behavior
<whitequark>
I have a severe allergy to magic now
Rotacidni has quit [Ping timeout: 240 seconds]
<Drup>
whitequark: have you ever done some haskell :3
<Drup>
+?
<whitequark>
Drup: I won't disagree, but point out that proliferation of options can be quite confusing, resulting in incompatible codebases and such
wmealing1 has joined #ocaml
<whitequark>
but since it is the current behavior, I suppose keeping compatibility makes sense as well
<whitequark>
(haskell) nope
<whitequark>
I kinda like the idea in theory, as it has typeclasses and flexible types and some other things that OCaml severely misses
<whitequark>
but listening to some rants about haskell in here I'm starting to doubt if it's worth it :p
<Drup>
it's always interesting to try another language
<Drup>
at least to see how stuff are done there
<whitequark>
well, sure. but ocaml went from "cool, MLs are nice" to practically my main language for non-webdev now
<whitequark>
this probably won't happen with haskell
<Drup>
you're not doing your webdev in ocaml ?!
<whitequark>
RoR only
<Drup>
traitor !
<Drup>
:D
<Drup>
haskell is still an interesting beast to try, as the idioms are very different than ocaml's one
<Drup>
(I was a bit surprised about that at first)
<whitequark>
although the fact that just in the past week there've been no less than a dozen unique NoMethodErrors in this codebase makes me somewhat doubt that RoR is a good choice for webdev :p
<whitequark>
I mean, that, and the fact that our rspec suite runs for no less than ten minutes, which has an effect on writing tests which is about the one that you'd expect
angerman has quit [Quit: Gone]
<companion_cube>
time to use ocsigen !
<whitequark>
ocsigen seems to be a quite tiny hammer
<whitequark>
I mean, it forces a very particular communication model on you that is not compatible with webdev as it is usually done (i.e. an API server and a separately written app in JS)
<adrien_oww>
tiny hammer?
<adrien_oww>
whitequark: that way you keep the API and its usage consisten
<adrien_oww>
which is definitely a plus
<whitequark>
well, it's a side effect of the fact that the "PHP model" (mix everything in one codebase) is unsustainable, especially without types, but the point stands
<Drup>
"especially without types" <- right on point.
<Drup>
also, thanks to ML modules system, it's far less of an issue
<whitequark>
I also wish it used something more modern than plain Comet
<Drup>
like ?
metasyntax has quit [Quit: Leaving]
<whitequark>
websockets
<Drup>
you can use websockets too
<whitequark>
oh, nice. I'll probably check it out then
<whitequark>
perhaps for personal projects
<Drup>
it's maybe not as integrated than the comet stuff
<Drup>
but that's probably fixable with a nice library
<Drup>
this part is in library space anyway, it's not in the core of eliom
<whitequark>
for my last project, I believe I've needed changesets for every single dependency, including ocaml itself
<whitequark>
I guess it is fixable, yes -_-'
<whitequark>
(every single dependency) transitively, for that matter.
<Drup>
in library space :)
<Drup>
whitequark: the client value + injection mechanisms doesn't involve comet (or any communication for that matter)
<whitequark>
I see
<Drup>
I really need to finish this article X_x
oriba has joined #ocaml
maattdd has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
ollehar has joined #ocaml
struktured has joined #ocaml
Hannibal_Smith has joined #ocaml
studybot_ has quit [Read error: Connection reset by peer]
deavidsedice has joined #ocaml
studybot_ has joined #ocaml
deavid has quit [Ping timeout: 252 seconds]
studybo__ has joined #ocaml
darkf has quit [Quit: Leaving]
studybot_ has quit [Ping timeout: 264 seconds]
studybo__ has quit [Remote host closed the connection]
studybot_ has joined #ocaml
studybot_ has quit [Remote host closed the connection]
jonludlam has quit [Ping timeout: 264 seconds]
studybot_ has joined #ocaml
rgrinberg has joined #ocaml
studybot_ has quit [Remote host closed the connection]
<whitequark>
hm, how do I force the compiler to specialize compare?
divyanshu has quit [Quit: Computer has gone to sleep.]
<whitequark>
plus, I prefer to avoid GADTs if I can
<avsm>
dsheets: pity the 4.02 inliner would miss this i think, since publickeybytes is a string
<whitequark>
jpdeplaix: nice one
<dsheets>
but i do think the sz_query_type can be lifted out of all the submods and the return type could be a ctypes view over size_t
<Drup>
whitequark: not the playful type, aren't you ?
<whitequark>
Drup: I used to think GADT was an appropriate solution to many problems. then I took a type error to the knee
<avsm>
whitequark: that's why you have two knees, and an axe!
<dsheets>
avsm, what do you mean? publickeybytes is an int?
<avsm>
but yeah, they can be dense
* avsm
still fondly remembers his 2MB type error from OCamlDuce
<whitequark>
whoa
<Drup>
avsm: that was not gadt, wasn't it ?
<avsm>
dsheets: oh eck yes. this should be statically evaluated in 4.02dev then. ought to verify
<Drup>
just plain old poly variant ?
<avsm>
Drup: nah, xml tree combinators over xhtml
<whitequark>
avsm: probably not, since it's derived from a call to a dynamically loaded library
<dsheets>
whitequark, the dynload can be replaced with stubgen in most cases...
<Drup>
avsm: you can have those too in tyxml, from time to time
<dsheets>
need ctypes 0.3
<avsm>
dsheets: still wouldnt be statically evaluated by the compiler though, due to external:
<whitequark>
dsheets: yes, that would be nice
<dsheets>
but anyway, it will only get called once
<whitequark>
I cringe thinking of all the unnecessary stuff libffi does on each call
<whitequark>
avsm: what if it was an external constant?
<whitequark>
and smth like int xxx_publickeybytes = 24; in the C file
<avsm>
whitequark: no way of signalling this to the compiler
<whitequark>
hm? "external foo : int = "bar" wouldn't work?
<dsheets>
are external non-function values supported?
<Drup>
whitequark: that's the one thing that puzzle me about ctypes, yes
<whitequark>
Drup: it's not *too* bad, but it has orders of magnitude more moving parts than just an external part
<whitequark>
*external call
<dsheets>
the abstraction is solid, the implementation will get streamlined. libffi will still be necessary for closure handling
shinnya has joined #ocaml
<Drup>
I'm just wondering if the ctypes description is not enough to generate static stuff, but since I know almost nothing about the interaction with C.. :p
<whitequark>
dsheets: I don't think so, there are fundamental limitations of the libdl approach
<dsheets>
whitequark, which part?
<whitequark>
for example, the way you have to go through libffi to put values on stack if you don't have access to the C compiler
<whitequark>
you need *something* to implement the ABI, and something to wrap the ABI-implementing part into
<whitequark>
ctypes currently uses libffi for first and wraps it into GADTs for second. no way around that.
<whitequark>
Drup: it is, there's an experimental branch which generates those
<Drup>
oh, nice :)
<dsheets>
huh?? ctypes can do stubgen. are you saying there is a problem with the abstraction? the implementation can't be streamlined? libffi isn't necessary for closures support?
<whitequark>
dsheets: I mean you can't go faster without stubgen.
<dsheets>
of course, i don't deny that. i count libffi -> stubgen as "implementation detail"
<whitequark>
I see
jonludlam has joined #ocaml
<avsm>
there are some things that can only be done in one or the other
<avsm>
macros -> stubgen; infinite function pointers -> libffi
<whitequark>
... infinite function pointers?
<whitequark>
why would you ever want that?!
axiles has quit [Ping timeout: 252 seconds]
<adrien_oww>
btw
<adrien_oww>
have their been work for ctypes for C++?
<whitequark>
you mean binding directly to C++ methods?
<adrien_oww>
because that's where something with libffi is the most needed
<dsheets>
i think we'll probably end with a hybrid system that uses 2 extra stages and libffi to get me a pony
lostcuaz has joined #ocaml
<adrien_oww>
whitequark: mostly to handle objects and inheritance
<whitequark>
adrien_oww: people keep wanting to have an FFI for C++, but it's more or less impossible
<whitequark>
tl;dr: forget about it
<adrien_oww>
but that means vtable handling
<adrien_oww>
and that...
<whitequark>
you are not going to implement several incompatible, incredibly contrived C++ ABIs
ygrek has joined #ocaml
<adrien_oww>
implement only one, support only that one
<whitequark>
I mean, LLVM struggles to implement MSVC's ABI for several months
axiles has joined #ocaml
<adrien_oww>
GCC isn't compatible with MSVC's C++ ABI currently anyway
<whitequark>
yeah, and what is value in that "solution"?
<adrien_oww>
heh
<whitequark>
"best viewed in Netscape Navigator 4.0"
<adrien_oww>
well
<adrien_oww>
I'm not going to talk about LLVM's windows support
<whitequark>
realistically, the way to go for C++ bindings is write C++ code to wrap them in C, contribute that to the project, and wrap that
<whitequark>
the direct way has never worked for anyone because of its sheer complexity
<adrien_oww>
whitequark: what value? you'd have at least some support as compared to none right now
<whitequark>
I'd rather not have an ad-hoc, non-portable solution at all
<whitequark>
that will easily break, too
<adrien_oww>
and the ability to do the bindings at runtime make it possible to only create the required code and would reduce the complexity a lot
<adrien_oww>
why would it easily break?
<adrien_oww>
more than C++ shared libraries?
<whitequark>
C++ ABI is essentially an implementation detail
<whitequark>
there is no reason what you propose would be simpler than writing a C wrapper
<adrien_oww>
and it's incompatible between different implementations
<adrien_oww>
what I'm talking about is support for the GNU toolchains and inside the GNU toolchains
<adrien_oww>
(GNU or LLVM, see with the LLVM whether they're interested in cooperation which they don't seem to be)
<whitequark>
yes, we clearly need more GNU-specific extensions.</sarcasm>
<adrien_oww>
(for the windows part at least)
<adrien_oww>
thing is that it's LLVM which started the non-cooperation on windows
<Drup>
adrien : why is a C wrapper not portable ?
<adrien_oww>
all while GCC is trying to be more compatible with MSVC
<whitequark>
adrien_oww: your data may be outdated
<adrien_oww>
so same goal, started later on and independant efforts
<adrien_oww>
whitequark: link?
<whitequark>
discussions in llvm-dev and #llvm mainly
<adrien_oww>
Drup: it's not that it isn't portable, it's that it's too big
<adrien_oww>
hmmm, kay
<adrien_oww>
what was it saying?
<whitequark>
I see that LLVM attempts to faithfully follow MSVC's conventions
<whitequark>
which is nice, because it uses existing platform ABI instead of inventing their own
<whitequark>
e.g. MSVC-compatible C++ mangling
<adrien_oww>
yes and? as I said:
<adrien_oww>
16:03 < adrien_oww> all while GCC is trying to be more compatible with MSVC
<whitequark>
if gcc has the same goal, they will naturally converge, won't they?
<adrien_oww>
but as you can guess there's quite some work involved in that compatibility
<whitequark>
surely
skchrko has quit [Quit: Leaving]
<adrien_oww>
so blaming GCC/GNU is easy but a bit too simple
<whitequark>
I'm not blaming GNU, I'm saying we don't need to go from portable solution to a GNU-specific solution
<whitequark>
"it's too big" is a far too weak argument for this
<whitequark>
btw: you can probably use stubgen to generate the bindings for you, if you're so inclined to use ctypes for the goal
<adrien_oww>
portable solutions? like? which ones are practical?
<whitequark>
the C wrapper.
<whitequark>
it's absolutely practical, all FFI-able projects in C++ use it
<adrien_oww>
as for being GNU-specific, as I said, the goal is to be compatible with MSVC so that wouldn't be specific
<adrien_oww>
C wrapper for Qt? sure, as we've seen it's easy and practical and terribly successful
<whitequark>
lol, I do not believe we will see a libffi-like library that implements MSVC's ABI any time soon
<adrien_oww>
why not?
<whitequark>
too complex and not enough incentive for that kind of work
<adrien_oww>
if GCC is moving to the MSVC ABI, why wouldn't libfii?
<whitequark>
I see what it takes for LLVM to implement that ABI and they have several full-time employees specializing in that
<whitequark>
because libffi doesn't implement *any* C++ ABI and it reimplements the C ABI for every single platform it supports, itself
<adrien_oww>
GCC is fairly close to MSVC compatibility
<adrien_oww>
only a few issues left
<whitequark>
it is irrelevant what GCC is using if we talk about libffi
<adrien_oww>
so not sure why LLVM is having so much trouble
<adrien_oww>
libffi is used inside GCC
<adrien_oww>
for java but it is used
<whitequark>
that really doesn't say anything
skchrko has joined #ocaml
<adrien_oww>
sounds like a good inclination to me
<whitequark>
(much trouble) is it possible to, say, use a template instantiation compiled with G++ from file compiled with MSVC?
<whitequark>
that's what LLVM is aiming for
<whitequark>
I'll repeat, libffi does not currently implement *any* C++ ABI and gcj doesn't need or want that
<whitequark>
(and gcj is dead anyway)
<adrien_oww>
I never remember the specifics of what is compatible or not but I know the compatibility is not that far away
<adrien_oww>
and it's getting more and more compatible
<adrien_oww>
(with fewer resources than LLVM so it's getting there at its own pace)
<whitequark>
I don't currently see any indication that it's possible to link together C++ code compiled by GCC and MSVC
<adrien_oww>
actually I'm not even sure that would require specific handling of the C++ ABI
<whitequark>
I see references to bringing together the memory and exception models, which is another issue
<adrien_oww>
as I said, the support is not there yet but getting closer
<whitequark>
adrien_oww: btw, another consideration about binding to C++ dynamically is templating
<whitequark>
how would you bind to std::list<int>, for example? you will not
shinnya has quit [Ping timeout: 265 seconds]
<whitequark>
this is the issue with Qt, in particular
<whitequark>
and anyway Qt bindings can be done just fine with SMOKE, as evident by the Ruby ones
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
divyanshu has joined #ocaml
<ggole>
C++ bindings bring pain everywhere they go
<adrien_oww>
I don't know well how smoke works so can't comment on that
angerman has joined #ocaml
<adrien_oww>
and no idea if it's actually usable in ocaml under sane conditions
<Hannibal_Smith>
What about SWIG?
eizo has quit [Quit: Page closed]
angerman has left #ocaml []
<adrien_oww>
the code which is generated can only be read by cthulhu
rgrinberg has quit [Quit: Leaving.]
<cthuluh>
well, I didn't puke but I didn't enjoy it either
<adrien_oww>
heh :)
rgrinberg has joined #ocaml
<adrien_oww>
I made sure you didn't highlight ;-)
<cthuluh>
no hilight involved; I was just reading your mind
<adrien_oww>
:D
<adrien_oww>
(poor you)
rgrinberg has quit [Client Quit]
wmealing1 has quit [Quit: Leaving.]
wmealing1 has joined #ocaml
rgrinberg has joined #ocaml
metasyntax has joined #ocaml
divyanshu has quit [Ping timeout: 255 seconds]
fantasticsid has joined #ocaml
q66 has joined #ocaml
q66 has quit [Changing host]
q66 has joined #ocaml
Rotacidni has joined #ocaml
divyanshu has joined #ocaml
ollehar1 has quit [Quit: ollehar1]
ollehar1 has joined #ocaml
ollehar1 has quit [Client Quit]
emias has quit [Ping timeout: 252 seconds]
Snark has quit [Ping timeout: 240 seconds]
maattdd has quit [Ping timeout: 252 seconds]
emias_ has joined #ocaml
emias_ has quit [Client Quit]
ollehar1 has joined #ocaml
yan_ has quit [Remote host closed the connection]
wmealing1 has quit [Quit: Leaving.]
tlockney_away is now known as tlockney
HoloIRCUser1 has joined #ocaml
emias has joined #ocaml
HoloIRCUser has quit [Ping timeout: 252 seconds]
fantasticsid has quit [Ping timeout: 240 seconds]
yan_ has joined #ocaml
maattdd has joined #ocaml
ollehar has quit [Ping timeout: 252 seconds]
jonludlam has quit [Ping timeout: 265 seconds]
yan_ has quit [Client Quit]
yan_ has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
HoloIRCUser has joined #ocaml
axiles has quit [Ping timeout: 252 seconds]
axiles has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
HoloIRCUser1 has quit [Ping timeout: 240 seconds]
Snark has joined #ocaml
rgrinberg has joined #ocaml
yan_ has quit [Remote host closed the connection]
yan_ has joined #ocaml
wwilly has quit [Ping timeout: 245 seconds]
angerman has joined #ocaml
jonludlam has joined #ocaml
Submarine has quit [Remote host closed the connection]
<Drup>
ggole: it's only merlin not having all the informations :)
<mrvn>
WTF is that?
<ggole>
Apparently "Bessel functions of the second kind"
<ggole>
The __attribute__ stuff is some gcc specific crud
<Drup>
ggole: iirc, it's an 'a
<ggole>
Ah, right
jonludlam has quit [Ping timeout: 265 seconds]
oriba has quit [Remote host closed the connection]
<companion_cube>
Drup: sounds like the (string * 'a list) list should have a type alias
<Drup>
companion_cube: it does, I just copy pasted the type inferred by merlin. It's an internal function anyway
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<Drup>
I was just an answering the "a list is always a list anyway" argument
avsm has joined #ocaml
<mrvn>
well, there is '_a list and then there is 'a list. :)
<companion_cube>
ah
<mrvn>
b list or b square.
pminten has quit [Quit: Leaving]
amirmc has joined #ocaml
angerman has quit [Ping timeout: 240 seconds]
foocraft has joined #ocaml
maattdd has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
nikki93 has joined #ocaml
maattdd has quit [Ping timeout: 252 seconds]
<_obad_>
does opam work for windows? the link on the ocamlpro page is a mailto:
<smondet>
_obad_: last time I tried it didn't build, but I've seen some commits related to the build process recently
<smondet>
so, maybe the dev version...
Kakadu has joined #ocaml
malo has joined #ocaml
manizzle has joined #ocaml
<_obad_>
smondet: hmm... I "just" need some graphical interface and Lwt
dsheets has quit [Ping timeout: 252 seconds]
<whitequark>
lablgtk2 is compatible with lwt
angerman has joined #ocaml
<_obad_>
but how much of a pain is it to get it for windows?
<Drup>
not much
<whitequark>
a moderate amount of suffering is appropriate for this situation
<Drup>
since adrien is working on it :p
<adrien>
am not
<Drup>
adrien : didn't you use lablgtk2 on windows ?
<adrien>
thing is that building on windows is going to be slooooooow
<whitequark>
forks?
<adrien>
ah, thought you were saying I was working on opam on windows
<adrien>
I've used lablgtk2 on windows
<_obad_>
well I don't care about speed. I'll develop it under linux and when I have a prod version I'll compile it under windows and go for a coffee or something.
<adrien>
but even without that, Garrigues builds on Windows before _every_ release
<whitequark>
go for a vacation :p
<_obad_>
ok I see lablgtk2 is well supported.. what about lwt?
<adrien>
_obad_: if you drink coffee while it's building, you might drink lots of coffee :)
<adrien>
_obad_: when will you need the windows version?
<Drup>
hide !
frankjeager has quit [Quit: Quitte]
<Drup>
he's going to talk about win-build
<adrien>
lwt worked when I used it 3 years ago
<adrien>
haven't tried since
<_obad_>
adrien: erm a month max. but I need to know exactly what is supported since I'll be writing code very soon
<adrien>
Drup: nope
<adrien>
several months I would have mentionned cross-compilation
<_obad_>
oh god no
<Drup>
adrien : such feint :(
<adrien>
why? :o
<Kakadu>
_obad_: Have you considered Qt?
<_obad_>
do we have ocaml bindings?
<adrien>
_obad_: lwt should work; I think it's tested on windows too
<_obad_>
adrien: cool...
<Kakadu>
_obad_: not really bindings but We can call OCaml from QtQuick
<adrien>
be sure to read documentation about windows support in the various projects you might use
jonludlam has joined #ocaml
<adrien>
might save a few surprises
<adrien>
s/save/avoid/
<_obad_>
adrien: yeah. that and testing it for yourself first...
<_obad_>
oh god there is this lwt syntax extension business.
<_obad_>
I've been using lwt.syntax. maybe I should stop before it's too late.
<whitequark>
Drup has just reimplemented it via ppx
<_obad_>
that's going to cause headaches under windows. I can feel it.
<Drup>
why is that an issue ?
<Drup>
whitequark: not ready yet :p
<_obad_>
I don't know, does it work?
<_obad_>
also the ppx version will have different syntax
<_obad_>
drup: I don't know, maybe there won't be an issue. I just had bad experiences with syntax extensions in the past.
<adrien>
_obad_: the syntax extension should be fine on windows
<adrien>
but, hmm, yeah
<_obad_>
adrien: ok.
<adrien>
it might save you some hassle to avoid it
<adrien>
if you don't have tons of lwt code and really need/want it, try without
<_obad_>
yeah I don't want to pepper my code with lwt () = blah and then have to fix it everywhere
<whitequark>
Kakadu: you've got a typo: "Керенина" in the tutorial
AltGr has left #ocaml []
<_obad_>
installing ocaml on windows as we speak (in a virtual machine of course)
<adrien>
jonathan protzenko's installer?
<_obad_>
adrien: y
<adrien>
works well; found a couple small flaws but nothing worrying
<whitequark>
Kakadu: also lablqt looks pretty great
<_obad_>
wow it even has findlib
<_obad_>
whitequark: is that a Q as in lablQt?
squiggnet has quit [Ping timeout: 252 seconds]
<whitequark>
hm?
<_obad_>
I see. there is a lablqt by kakadu. wasn't aware of that..
<_obad_>
q looked like a truncated g
<adrien>
wrong font :P
<_obad_>
time to run xfontsel
<whitequark>
how can anyone tolerate x fonts, I don't even know
<_obad_>
you mean bitmap fonts?
<whitequark>
I mean the unfathomable crap that passes for a font rendering engine in X
<whitequark>
I don't care how is it implemented
<_obad_>
works fine for fixed-width :)
<adrien>
I like them
<adrien>
my main reason is that they have no AA and no subpixel-hinting
<adrien>
AA looks blurry to some
<_obad_>
AA is a stop-gap for low dpi displays
<whitequark>
I hate subpixel AA as well (no such thing as subpixel-hinting), but that's easily turned off
<whitequark>
not quite, hinting is
<adrien>
subpixel-hinting makes red, blue or green bars appear to the left of right of sharp-edged elements for some people
<whitequark>
subpixel antialiasing.
<adrien>
apparently that would be far less a concern with higher DPIs display
<adrien>
but until I get other displays...
<_obad_>
adrien: exactly my point. I think my nexus 5 doesn't even do subpixel/AA.
<whitequark>
hinting is a different concept. hinting means the instructions embedded in the font that correct the rasterization by aligning the lines with the grid
<_obad_>
I can't see the pixels.
* whitequark
has a laptop with DPI=170
<whitequark>
there's no subpixel AA or hinting, but without regular AA it looks considerably worse.
<adrien>
_obad_: well, yeah, they would need it; but I think it might still be enabled
<adrien>
but not visible
<whitequark>
nexus doesn't do subpixel for a different reason
<whitequark>
you can rotate the image, but not the pixels themselves
<Kakadu>
whitequark: Spelling fix is pushed
<adrien>
170 is fairly high DPI
<adrien>
heh, true
<adrien>
hmm
<whitequark>
170 is "retina", meaning the pixels are invisible on a proper viewing distance
squiggnet has joined #ocaml
<adrien>
I'm fairly sure several smartphone screens have symmetric displays (according to the x=y line)
<whitequark>
it's really great, except linux support is a bit flaky
<whitequark>
adrien: hm?
<whitequark>
oh, you mean PenTile and the like
<whitequark>
it's not quite like that, you still have the arrangement of dots that is not symmetric within a single pixel
<_obad_>
so do I install the lablgtk zip from ocamlcore.org or can findlib install it?
<whitequark>
and if you do have PenTile, the display controller itself does a kind of subpixel rendering, because you have different resolution on different color channels
<whitequark>
additionally using subpixel AA on rendered fonts would just make it worse
<whitequark>
imo pentile should die. it exists just because samsung is cheap.
<whitequark>
adrien: sure, it is pentile. see, the G resolution is 2x higher than R/B
<adrien>
_obad_: lablgtk.forge.ocamlcore.org
<whitequark>
unlie with regular RGB pixels which consist of three stripes
sagotch has joined #ocaml
<whitequark>
so, the display controller/firmware approximates the G dots from their nearest neighbours or something like that
<_obad_>
adrien: indeed it's not listed by ocamlfind.
<whitequark>
this would interfere with your attempts at subpixel, because it doesn't really expect any further mangling. and afaik all existing algorithms are done for linear pixels. and to further complicate it, you need a lot of software hooks to update all this on rotation
<whitequark>
it's just pointless.
divyanshu has quit [Quit: Computer has gone to sleep.]
<adrien>
_obad_: you got the precompiled binaries?
<_obad_>
yes and I opened the zip, now I have to intall gtk+-bundle
nikki93 has quit [Remote host closed the connection]
<adrien>
yup, if the controller does it, doing it in software will not work
<_obad_>
stupid windows won't move directories because they are "busy"...
<flux>
pentile is like the 2010's version of interlacing :)
nikki93 has joined #ocaml
nikki93 has quit [Read error: Connection reset by peer]
nikki93 has joined #ocaml
maattdd has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<sagotch>
hey
<sagotch>
Do you know if Digest.input is supposed to give the same result than md5sum command-line tool ?
<adrien>
should I think
maattdd has quit [Ping timeout: 240 seconds]
<_obad_>
I think too
<adrien>
_obad_: never forget that on windows or it'll bite you
<adrien>
(for the busy stuff on windows)
<_obad_>
adrien: how do I get the lablgtk stublibs onto the search path?
<adrien>
search path for what?
<_obad_>
basically I get "dlllablgtk2.dll: the specified module could not be found"
<_obad_>
when I run lablgtk2
<_obad_>
I see that those dlls are under the lablgtk directory
<adrien>
and no META in the binary tarball, but there's one in the git repo; use that
<adrien>
what are you running to get that error message?
<_obad_>
just lablgtk2
<_obad_>
on some example.ml
<adrien>
"lablgtk" is not using findlib iirc
<_obad_>
the required dlls are under /opt/lablgtk/lib/stublibs
<adrien>
lablgtk2 -h ?
<_obad_>
but there is nothing in the readme about moving them
<adrien>
-I maybe :P
<_obad_>
oh
<_obad_>
adrien: yes :) -I /opt/lablgtk/lib/stublibs did the trick
<adrien>
other way
<adrien>
ocaml
<adrien>
#use "topfind";;
<adrien>
#threads;;
<adrien>
#require "lablgtk2.auto-init";;
<adrien>
correction: #thread, not #threads
<_obad_>
wait now I need to produce an .exe that I can ship to windows people
<_obad_>
adrien: that's not what the lablgtk readme said
<adrien>
then I need to change it :P
* adrien
is scared to git fetch in his lablgtk repo
<adrien>
errr
<_obad_>
and I get a shitload of assertion faults and a segmentation fault. sounds like gtkinit.cmx is not linked in
<adrien>
no commit since the last time...
<adrien>
NO!
<adrien>
DO NOT LINK THAT FILE!
<adrien>
20:40 adrien : (and do the gtk initialization explicitely)
<_obad_>
k how does one do that
<adrien>
don't remember exactly :D
<adrien>
something like
<adrien>
let locale = GtkMain.Main.init ()
<_obad_>
linking with it seems to work though :)
<adrien>
which is actually's gtkInit.ml's source
<adrien>
if you link the module, you don't control when the initialization happen
<_obad_>
oh ok
<_obad_>
fine
<adrien>
and then you end up with software which requires X to be able to run "foo --help"
<adrien>
also
<_obad_>
X? lol
<adrien>
when GTK is built against X ;-)
<_obad_>
fair enough
<_obad_>
ok now how do I ship this shit
<adrien>
and you might want to change the call above to something else if you're going to use multithreading
<adrien>
where did you read that you should/could link that file in?
<_obad_>
I'll be using lwt
<_obad_>
the README that comes with the lablgtk zip
<adrien>
I need to make that clearer
<adrien>
it's for convenience when trying out stuff in the toplevel
<adrien>
so that "lablgtk2" gives you something which can run gtk calls right away
<adrien>
I should probably try to restrict the availability of the module to toplevels
<_obad_>
now silly windows question. I copied all the external gtk dlls into a dir and put the .exe in it. if I zip that and send it to people, would that work? I guess I'll find out soon
<adrien>
should
<_obad_>
I'll use a co-worker as a guinea pig
<whitequark>
harsh
<adrien>
you need interns
dsheets has joined #ocaml
<_obad_>
adrien: we're getting some soon
<_obad_>
ok it worked, though it opened an ugly terminal window in the background
<_obad_>
thanks for your help!!! ;)
<adrien>
-cclib -bahIneedtocheckld'smanpage
<whitequark>
ew
<adrien>
-cclib "-Wl,--subsystem windows"
<adrien>
should take care of the window
<adrien>
but watch out what happens to your std{in,err,out}
<_obad_>
flexlink: unknown option -Wl,--subsystem
<adrien>
ah, right
rgrinberg has quit [Quit: Leaving.]
<adrien>
-cclib "-subsystem windows"
<adrien>
or
<adrien>
-cclib -subsystem -cclib windows
Arsenik has joined #ocaml
olauzon has joined #ocaml
<_obad_>
thanks! that worked as well
<_obad_>
a surprisingly smooth experience.
Submarine has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
<adrien>
oh, installation is always simple on windows
<adrien>
updates...
ygrek has quit [Ping timeout: 240 seconds]
<_obad_>
I'll need to brainwash the interns into using ocaml as well
<_obad_>
now it's lwt's turn.
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
<adrien>
interns don't have the right to free will
<_obad_>
how about: I'll need to brainwas the interns into using ocaml AND NOT BITCH ABOUT IT
<hnrgrgr>
1/win2
<_obad_>
where did the ocaml installer put cygwin's setup*.exe?
<_obad_>
I need to install git now...
<adrien>
worst case you can download it again and point it to your current installation
<_obad_>
what if I mismatch the version number?
<adrien>
setup.exe doesn't have a version number
<_obad_>
ok and cygchec reports 1.7.29 for the main dll
clan has joined #ocaml
shinnya has joined #ocaml
<_obad_>
do you know what dependncies are needed by lwt? do I need libev?
<mrvn>
_obad_: oasis will tell you
<mrvn>
or opam or findlib
WraithM has quit [Quit: Changing server]
<_obad_>
oh no I'm not installing oasis under windows. that thing has a lot of dependencies of its own
WraithM has joined #ocaml
<adrien>
you can do with select()
<adrien>
_obad_: oasis has no dependency when running
<_obad_>
does it work under windows on sockets?
<adrien>
well
<adrien>
I mean
<_obad_>
and anyway there is no libev in the cygwin package list
<adrien>
select() only works on sockets on windows iirc
<mrvn>
does ocaml have sockets under windows?
<Drup>
the build system generated by oasis does not depend on oasis
<adrien>
mrvn: of course
<adrien>
what Drup said
<Drup>
but you can still look the oasis to see the dependencies :)
<adrien>
_obad_: anyway, you'd need a mingw* version of libev, not the packages native to cygwin
<_obad_>
adrien: you mean: select works only on sockets under windows
<adrien>
windows's select() only works on sockets
<adrien>
(and non-blocking ones?)
<adrien>
something like that
<_obad_>
drup: hmm ok so I just copy the setup.ml and _tags and shit to windows
<adrien>
iow, if you can, avoid doing it yourself
<mrvn>
no pipes under windows?
<adrien>
_obad_: aren't those files already in the tarball of lwt?
<adrien>
mrvn: didn't say that
<Drup>
in the tarball, probably
<adrien>
that select() works or not doesn't mean pipes exist or not
<Drup>
in the git, the build system is not the "independent" one
<Drup>
it's a dynamic stuff
<_obad_>
adrien: yes but I was going to install git to clone ocisgen/lwt and then run setup.ml
<adrien>
ah
<adrien>
use the releases
<_obad_>
ok
maattdd has joined #ocaml
<adrien>
the more you diverge from released versions, the more you get code that has not been tested under windows
<_obad_>
the last lwt commit is by diml for a bug I stumbled on
<adrien>
steal only that commit
amirmc has quit [Quit: Leaving.]
rgrinberg has quit [Quit: Leaving.]
maattdd has quit [Ping timeout: 240 seconds]
<_obad_>
I need react too, and that one doesn't use oasis.
rgrinberg has joined #ocaml
<_obad_>
I called ocaml pkg/build.ml ... to build it, but how do I install it?
<_obad_>
this is for react which uses opam.
<Drup>
you cry
<adrien>
krkrkr
<Drup>
and you look at opam-installer
<adrien>
you're going to do react + lwt + lablgtk + windows?
<_obad_>
yes
<_obad_>
I already have code that uses lwt + react
<adrien>
I'm sorry to let you know that you might be on the same path as I was
<mrvn>
I'm not going to react to windows.
<adrien>
i.e. you might end up like me
<adrien>
sorry, that's a sad end ='(
<_obad_>
adrien: how did you end up?
<_obad_>
homeless?
<Drup>
(I concur, adrien is a sad end)
<adrien>
lablgtk commiter (although inactive at the moment), changing ocaml's build system and doing package management for windows
<adrien>
see, you better run for your life :P
<adrien>
more seriously, I'm curious as to what the results will be
<_obad_>
I could send you a can of fine grade B maple syrup
<_obad_>
and let you do the work!
<adrien>
I know how I would do GUIs with frp and everything, I'm curious as to how you would
<_obad_>
well I have code that talks over a serial link to some embedded stuff
<adrien>
maple syrup + whisky = Sortilège \o/
<_obad_>
and some other people will need to use a GUI to talk to that piece of hardware using that code. and of course they use windows.
<_obad_>
so anyway... the react pkg/build.ml produced a react.install file which is a strange doc: [ "blah" {blah} ] syntax
<_obad_>
maybe I should just invoke ocamlfind manually
<adrien>
:D
zpe has quit [Remote host closed the connection]
<Drup>
_obad_ that's opam syntax
ollehar has joined #ocaml
<adrien>
Daniel Bünzli says you should read the code there and adapt to your needs
<_obad_>
drup: no kidding. now what do I do with it?
<Drup>
I told you
<Drup>
you cry
zpe has joined #ocaml
<Drup>
(and you look at opam-install)
nikki93 has joined #ocaml
<_obad_>
so I just copied the pkg/META into _build/react and then ocamlfind install react *
<mrvn>
Put some : in filenames and dirs.
<mrvn>
ups
zpe has quit [Ping timeout: 252 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
olauzon_ has joined #ocaml
olauzon has quit [Ping timeout: 276 seconds]
olauzon_ is now known as olauzon
<_obad_>
lwt-2.4.3.tar.gz doesn't compile with ocaml 4.01 because of the O_CLOEXEC flag. do I just fix that line, or do I git clone the latest version?
<adrien>
work your way through how it builds the path and replace with forward-slashes
<_obad_>
I'm diffing the two setup.mls as we speak
<adrien>
don't remember the specifics for that issue even though I had it a few days ago
<adrien>
probably won't be very readable
<_obad_>
not that bad
<adrien>
:)
amirmc has joined #ocaml
<_obad_>
stupid ms-dos backslashes... I'm sure they did it on purpose to screw with unix
<_obad_>
we should put colons in paths everywhere as retaliation
clan has quit [Quit: clan]
<adrien>
actually, that was the idea, yeah :P
<_obad_>
really?
angerman has quit [Quit: Gone]
<adrien>
it was not to screw with unix
<adrien>
but to be different to some extent
<adrien>
ah, right
<adrien>
edit setup.data
<adrien>
replace backward slashes with forward ones
<adrien>
should fix the build
<_obad_>
yey! thanks!!
tane has quit [Quit: Verlassend]
_andre has quit [Quit: leaving]
amirmc has quit [Ping timeout: 264 seconds]
axiles has quit [Remote host closed the connection]
ikaros has quit [Quit: Ex-Chat]
<_obad_>
I need to install glib. I thought it would come with gtk
<_obad_>
otherwise no lwt_glib
tobiasBora has joined #ocaml
<_obad_>
oh glib is the ocaml binding apparently.
<adrien>
it does
<adrien>
there is no "glib" ocaml binding
<adrien>
it's in lablgtk
<ggole>
MSDOS took it from CPM afaik
<_obad_>
adrien: so you're right it's an ocamlfind package, but the setup.ml from lwt is complaining about a missing glib C library. however pkg-config reports flags for glib-2.0 so it's installed
<mrvn>
_obad_: the difference only shows when you apply a functor.
<samebchase>
The error I'm getting is This expression has type unit but an expression was expected of type String.Set.t = (string, String.comparator_witness) Set.t
<mrvn>
_obad_: MAKE(S) and MAKE(String) result in different types for older ocaml.
<Kakadu>
samebchase: Set.add returns new set
<mrvn>
samebchase: then don't pass unit
<_obad_>
ok for the types, but is the representation of module S = String any different?
<Kakadu>
samebchase: you expect that it returns unit
<_obad_>
i.e. does it copy the module struct, or does it use a pointer?
<samebchase>
okay, I'll try that and see
<samebchase>
the function passed to the inner iter should return unit, but it is returning the Set.t
<samebchase>
that results from the evaluation of the then branch
zpe has quit [Ping timeout: 265 seconds]
wmealing1 has joined #ocaml
<samebchase>
how do I make the fn return unit, instead of the set
<Kakadu>
samebchase: if you don't write `else` in if statement OCaml thinks that you have written `else ()`
<ggole>
It uses a pointer
Arsenik has quit [Remote host closed the connection]
<samebchase>
the then and else branches should have the same type?
<Kakadu>
samebchase: Yes
<ggole>
Actual references through S should be constant propagated to be the same as if they were written String though (afaik)
<_obad_>
signal handling in cygwin is so horrible... I launched ocaml setup.ml ... and then hit ^C -> lockup; I launched rlwrap -> lockup
<Kakadu>
samebchase: Are you aware of pure functional data structures (like set you are using)?
<samebchase>
what's the most elegant way of doing that here? Should I just have a () in the then and else branches to make them of the same type.
nikki93 has quit [Remote host closed the connection]
<samebchase>
Kakadu: The set I'm using in functional? I had the impression that it was imperative, with all the mutation I'm doing
zpe has joined #ocaml
<samebchase>
is functional*
<Kakadu>
samebchase: I'm almost sure that it is functional
<_obad_>
ggole: ok that's reassuring
<samebchase>
I mean I'm creating an empty set and adding stuff to it
<_obad_>
meanwhile the problem with the latest lwt oasis setup under windows boils down to Filename.quote not escaping backslashes;
<samebchase>
that's mutation, right?
<Kakadu>
samebchase: if add function has type 'a -> 'a t -> 'a t it isn't
<ggole>
You need to replace that iter with a suitable fold (or hand-written function)
<_obad_>
fg
<ggole>
(Does Batteries' String have a fold operation?)
<_obad_>
sorry :)
<ggole>
fg: current: no such job
marr has quit [Read error: Operation timed out]
<samebchase>
Yes. Now it makes sense. Thanks for the help!
<_obad_>
ggole: :)
nikki93 has joined #ocaml
<Kakadu>
samebchase: and (String.filter alphabet ~f:(fun remove_char -> remove_char <> word_char)) is not nice peace of code. Rewrite it when you will manage to get this piece of code work as expected, please
<samebchase>
I was looking for a String.remove or something like that,
<samebchase>
I need to remove one char from a string,
<samebchase>
what's the best way to acheive that?
ddosia1 has quit [Quit: Leaving.]
<Kakadu>
You would remove String.filter and add one more if to inner function (lines 10-15)
<samebchase>
oh
<samebchase>
okay
shinnya has quit [Ping timeout: 252 seconds]
<samebchase>
I understand how fold works here: List.fold [1;2;3;4;5] ~init:0 ~f:(+) ;;
<samebchase>
, but how do I use fold over a String.Set to add elements to it
<mrvn>
The same way
<samebchase>
, but here we are starting with an empty String.Set
<mrvn>
~init:Set.empty ~f:Set.add
<samebchase>
ah
clan has joined #ocaml
<samebchase>
the thing I'm having trouble with is, in the case of that list, we have some numbers and we pass a fn and an init value to reduce/fold that list into a single value from repeated applications of the fn
<Kakadu>
samebchase: I have read what do you want to get again and probably solution with mutable value suits better there
<samebchase>
Kakadu: yeah that's what it seems to me
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bacam has quit [Ping timeout: 240 seconds]
bacam has joined #ocaml
Bynbo7 has joined #ocaml
Axman6 has quit [Ping timeout: 256 seconds]
ollehar has quit [Ping timeout: 252 seconds]
marr has quit []
<whitequark>
jpdeplaix: 1) squash the a355f4f1a with previous
<whitequark>
2) I can't say much about the last two commits, as they're touching the buildsystem. You'd have to go through the usual LLVM review process--I would have, too
<whitequark>
3) for the all_backends part, remove all the separate initialize_* methods and pull it all into one. it doesn't make sense to keep them separate, because whether or not you call them, they'll cause the relevant modules to be linked in anyway