<bernardofpc>
(the definition of equality of morphisms is easier because we can take that from set theory ; for objects could have to define what it means for two objects to be equal, but fortunately most of the time this is never used ; we only take f: a -> a, never f: a->b with b=a)
jwatzman|work has quit [Quit: jwatzman|work]
<tautologico>
whitequark: cmdliner?
<whitequark>
applicative functors ಠ_ಠ
<tautologico>
it's cool, opam uses cmdliner if I'm not mistaken
<whitequark>
this looks horribly contrived
<whitequark>
I guess I'll stick to Arg for now
<tautologico>
wow you must love Haskell then :)
<whitequark>
exactly.
<tautologico>
if a simple applicative functor gives you allergies...
<nicoo>
whitequark: I believe that Cmdliner's use of an applicative functor is justified, in the sense that it fits in the design on the lib. It's not just here to please CT lovers :)
<whitequark>
nicoo: possibly. But I never understood the strange obsession with using machinery as far from the domain area as it's possible solely because it has a structure near to what you want.
<nicoo>
Well, my point was that, in Cmdliner's design, Applicative is exactly what one would want :3
* whitequark
growls
<tautologico>
if you're in the right state of mind, there's an aesthetic appreciation of the baroqueness of some Haskell code out there :)
<whitequark>
I prefer to appreciate baroque code with a flamethrower in hand, whether in Haskell or JavaScript ;p
<tautologico>
:)
fantasticsid has quit [Ping timeout: 252 seconds]
<nicoo>
tautologico: I tend to exit that state of mind when I run out of meds for the headaches ;)
<nicoo>
whitequark: Baroque code makes you go medieval ? :D
<tautologico>
I still think there should be a Haskell book called "Overengineering with Types"
<whitequark>
nicoo: our PM sometimes stick the tag "whitequarkerize" on tasks
<whitequark>
sticks*
<nicoo>
tautologico: A companion book should give encodings in C++ templates :>
<whitequark>
it usually involves at least an order of magnitude more git deletions than insertions
* nicoo
hugs whitequark
* whitequark
smiles
* nicoo
likes delketing code too
<nicoo>
deleting*
<whitequark>
a year ago, I inherited a codebase literally written by one guy on meth
<whitequark>
and I do mean "literally", you could guess where exactly the drugs weared off if you look at the code carefully
dapz has joined #ocaml
<whitequark>
It was horrible.
dapz has quit [Client Quit]
<whitequark>
I don't think I will ever forget.
<tautologico>
nicoo: with C++ templates in the mix I think the book would devolve into a Lovecraftian story
<whitequark>
NoNNaN: yes, I've read all of the dailywtf up to 2013.
* nicoo
administers liberal doses of therapetic hugs on whitequark :3
<whitequark>
nicoo: at one point, I looked at the code, then just sat there and cried for a few minutes.
<whitequark>
you don't even *nearly* have any idea how horrible can it be.
<NoNNaN>
the next step is probably some cobol->llvm->javascript compiler
<whitequark>
there was an 1.5kloc file with four intertwined Ruby classes which sort-of worked, but not a single person from our company could figure out how it was intended to be, um, designed
<tautologico>
MUMPS.js
<whitequark>
our CTO attempted no less than a half-dozen times to understand it and failed miserably
<xenocons>
but yeah, less of concept of unit in such a typed manner
<Drup>
you should investigate the "non termination" lead
<xenocons>
lazy?
<Drup>
such complication
<Drup>
do simple.
<Promit>
anything that can cause process death, for example
<Drup>
oh no, that's not fun
<whitequark>
for example, process cancer
<xenocons>
stack overflow!
<Drup>
No, I really mean non termination.
<bernardofpc>
decapitation
<xenocons>
non tail recursion !
<bernardofpc>
almost there
racycle__ has joined #ocaml
<Drup>
bonus point if you do it without any stuff from the standard library.
<Promit>
well my other idea was to invoke exit
<Drup>
no bonus point for that :p
<xenocons>
ah ffs
<xenocons>
it seems given that it cant be written in terms of identity, it cant be written with types and functions alone
<xenocons>
right?
<Drup>
it can be written with functions alone
<bernardofpc>
I think there's a solution with only 1-st ML course material
<xenocons>
damnit let p (x : unit) (f : 'a) =x;f;
<Drup>
x)
<xenocons>
dis teasing me
mcsquiggedy has joined #ocaml
mcsquiggedy has left #ocaml []
<Drup>
I would even say that it can be written with a function alone :p
<bernardofpc>
(and 17chars on my toplevel, 21 with more normal spacing)
squiggnet has joined #ocaml
<xenocons>
hrmm
<Drup>
bernardofpc: indeed, we probably have the same solution :p
<bernardofpc>
:D
<xenocons>
aha!
<xenocons>
got it
<xenocons>
let rec f () = f ()
<xenocons>
;p
<Drup>
well done, you have the bonus point x)
<xenocons>
yay
<Promit>
huh
<xenocons>
pretty obvious when you think about it :\
<bernardofpc>
yup
<Promit>
infinite loop is the last non-term solution
<Promit>
of course
claudiuc has joined #ocaml
nikki93 has quit [Remote host closed the connection]
<Drup>
it should have been the first one :p
<Promit>
granted
<xenocons>
it is the most obvious, im ashamed i didnt get it sooner, heh
<bernardofpc>
It's far from obvious, I think
<Promit>
but my assignment told me to look at pervasives for hints so that's why i wound up with the exception version
<Promit>
wish i'd thought of the infinite recurse :\
<bernardofpc>
only with some "type-guided development habit" you start to think this is "normal" then "natural"
<Promit>
out of curiosity, do you guys have any interest in the F# environment?
<Drup>
maybe it's because I produced this "typing anomaly" by accident when doing a main loop in lwt that I find that normal :p
<bernardofpc>
(I cannot make enough praise of the simple idea that "the function type will help you write the function itself" is so useful in OCaml)
<Drup>
bernardofpc: It's not that useful in OCaml
<Drup>
it's far more developed in Agda/Idris
<bernardofpc>
dunno those :/
<Drup>
(the compiled can actually write some function for you, if you give the complete type)
<bernardofpc>
oh, singleton inhabited types ?
<Drup>
yep
<Drup>
and nice proof search algorithms
<Drup>
all of it wrapped in deep emacs magic
<bernardofpc>
how often do these functions appear in real life ?
<xenocons>
Promit: i use F# almost exclusively
<bernardofpc>
deep emacs magic -> héhé
<xenocons>
(switching to ocaml atm)
mreca has joined #ocaml
<Drup>
bernardofpc: well, all of it, not that often
<Drup>
but part of it, quit often
<Promit>
ocaml wasn't really on my list of things to learn but now that i've been forced into it, i thought it might be interesting to try on more familiar territory (ie .net)
<Drup>
you loose the functor
<bernardofpc>
Promit: out of curiosity, who/what forced you ?
<xenocons>
F# is pretty good, its similar to ocaml in many ways
<xenocons>
Drup: you can the comp expressions + tooling
<Promit>
i'm taking a class
<Drup>
and functor are sooo cool
<Promit>
these guys are helping me wrap my head around the homework
<Promit>
"programming languages" is the uninspired name of the course
<Drup>
xenocons: you loose the tooling again if you are on linux :)
<xenocons>
Drup: definetly
<xenocons>
(which is why im trying to get up to speed with ocaml)
<Drup>
also, F# is barely open source.
<xenocons>
mono is pretty stable and fast, but ugh the tooling around it isn't really there
<bernardofpc>
xenocons: merlin+utop+(batteries or Core) will help you
<Drup>
xenocons: oh, that's do notation
<xenocons>
bernardofpc: yeah, ive been digging utop
<xenocons>
Drup: oh you are from haskell?
<whitequark>
Drup: I think MS recently opensourced a lot of their stack
<Drup>
do notation is a pretty common concept, don't need to be haskelish for that :p
<Drup>
whitequark: ""opensourced""
<xenocons>
ive only ever encountered it in haskell
<xenocons>
Drup: its getting better, its noway near ocaml in terms of open source
<Drup>
xenocons: but yeah, I did some haskell
<xenocons>
knew it ;p
<bernardofpc>
by the way" is there any place detailing all #-directives of toplevel ? I only recently found #use_mod (thanks to this channel) and I felt I should read more about it
<whitequark>
Drup: hm?
<mreca>
hey (hopefully) quick question: let's say i've read in a text file that contains "Hello World\n", where "\n" != '\n', and i want to replace "\n" with the newline character '\n'. I've tried doing Str.global_replace (Str.regexp "\\n") (String.make 1 '\n') myString, but so far it removes all n's as well...
<Drup>
whitequark: z3 too is open source
clan has quit [Quit: clan]
<Drup>
external contributions are isolated in a separate branch of the main one
<Drup>
and are basically invisible
<Drup>
"""open source"""
<xenocons>
Drup: biggest gripe for me atm coming to ocaml is probably twofold, libraries are annoying (or rather, lack of standard libs) and 'in' keyword ;p
<xenocons>
biggest pro so far: damn the feel of ocaml is squeaky clean
<xenocons>
writing much less type signatures than i do with F#
<Drup>
xenocons: agreed with the first one. Just use one of the two big standard library (Batteries or Core)
<xenocons>
yeah so i used batteries and i dont mean to pick, but it was buggy and slow (im generalising here)
<Drup>
buggy ?!
<xenocons>
diff is, with ocaml its up to you to fix, with F# you just have to wait a few years and MS will do it!
<whitequark>
it is a C ext and *also* requires Core?!
<rgrinberg>
whitequark: why the outrage?
<Drup>
well ...
<Drup>
"but it's a rather large dependency"
<whitequark>
rgrinberg: core is bloated and I don't want to have it; and re2 has nothing that requires core, in principle
<Drup>
rgrinberg: what is the advantage compared to ocaml-re ?
<rgrinberg>
Drup: sane api, probably faster
<Drup>
ocaml-re is not sane ?
<rgrinberg>
the api is very anemic
<rgrinberg>
unless youre using the carbon copy of Str
<Drup>
oh, right
<rgrinberg>
which puts you back at square one
<Drup>
(it's not really an insanity issue, but I agree)
<rgrinberg>
i don't think core is bloated either. maybe it looks that way because of how small stdlib is in comparison
<whitequark>
I'm pissed off because of link times and the amount of indirection in docs
<Drup>
my main point against core is the documentation
<rgrinberg>
just checked, it's 30k lines but at least of that is mlis + docs probably
<whitequark>
and for some weird reason core felt the need to reinvent lwt, which is also beyond me
<rgrinberg>
whitequark: but async is independent from core and they did improve on lwt (at least a little bit)
<Drup>
whitequark: well, they didn't reinvent it when they did Async .. since lwt was not there yet
<whitequark>
Drup: whoa, that explains it
<whitequark>
I thought lwt was ancient
<Drup>
it is
<Drup>
so is Async
<whitequark>
oh
<Drup>
it was just not released yet
<Drup>
rgrinberg: huh, no, they didn't. they messed up exception handling
<whitequark>
I see
<whitequark>
^
<xenocons>
i notice batteries Enum has no parallel
<xenocons>
is it because it isn't threadsafe or something
<rgrinberg>
Drup: they saw lwt messed up exception handling
<whitequark>
xenocons: it is because of the global lock. it doesn't in general make sense to use threads in ocaml
<Drup>
so they did worse ? :D
<whitequark>
since only one computation may proceed in parallel anyway
<rgrinberg>
Drup: why do you think it's worse?
* whitequark
fetches popcorn
<rgrinberg>
myself, i don't understand why lwt had to inline the error case in Lwt.t
<Drup>
I'm not sure it's worth it to have this conversation at 6h in the morning x)
<Drup>
rgrinberg: well, in lwt it's quite simple, you just have new construct for exceptions that have the exact same semantic as the regular one. You use them everywhere, you are done.
<Drup>
in Async .. I looked at it, I'm still not sure what's going on
ontologiae has quit [Ping timeout: 265 seconds]
<Drup>
I don't have the insider view, you will need to ask dimino for that, but as a user ...
<rgrinberg>
im the opposite i find async more intuitive view now
<Drup>
(and, again, Async is as documented as the rest of core)
<whitequark>
vim vs emacs, lwt vs async
<whitequark>
even the character counts are correct
<Drup>
:D
<rgrinberg>
just define exception handlers/catchers and structure them in a tree
testcocoon has quit [Quit: Coyote finally caught me]
clan has quit [Quit: clan]
studybot has quit [Remote host closed the connection]
testcocoon has joined #ocaml
studybot_ has joined #ocaml
clan has joined #ocaml
tautologico has quit [Quit: Connection closed for inactivity]
avsm has joined #ocaml
avsm has quit [Ping timeout: 276 seconds]
ggole has joined #ocaml
<flux>
nice
nikki93 has quit [Remote host closed the connection]
charliesome has left #ocaml []
AltGr has joined #ocaml
Nuki has joined #ocaml
studybot_ has quit [Remote host closed the connection]
Kakadu has joined #ocaml
maattdd has joined #ocaml
avsm1 has quit [Quit: Leaving.]
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
nikki93 has joined #ocaml
avsm has joined #ocaml
nikki93 has quit [Ping timeout: 252 seconds]
steshaw1 has quit [Quit: Leaving.]
Nuki has quit [Remote host closed the connection]
jao has quit [Ping timeout: 240 seconds]
ollehar has joined #ocaml
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
AltGr has left #ocaml []
Thooms has joined #ocaml
studybot_ has joined #ocaml
tane has joined #ocaml
Submarine has quit [Remote host closed the connection]
Thooms has quit [Quit: WeeChat 0.3.8]
studybot_ has quit [Remote host closed the connection]
studybot_ has joined #ocaml
jbrown has quit [Remote host closed the connection]
parcs has joined #ocaml
studybot_ has quit [Read error: Connection reset by peer]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
studybot_ has joined #ocaml
<jpdeplaix>
whitequark: I just tried to compile a program with target dependent optimizations. It's awesome !
ontologiae has joined #ocaml
malc has joined #ocaml
maattdd has quit [Ping timeout: 265 seconds]
malc is now known as malc_
avsm has joined #ocaml
avsm1 has joined #ocaml
troydm has joined #ocaml
<jpdeplaix>
whitequark: the lto pass should be used only for the resulting/last module, right ?
clan has quit [Quit: clan]
rand000 has quit [Ping timeout: 240 seconds]
maattdd has joined #ocaml
tane has quit [Quit: Verlassend]
maattdd has quit [Ping timeout: 240 seconds]
q66 has joined #ocaml
q66 has quit [Changing host]
q66 has joined #ocaml
rand000 has joined #ocaml
fraggle_ has joined #ocaml
maattdd has joined #ocaml
tane has joined #ocaml
shinnya has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
NoNNaN has quit [Ping timeout: 272 seconds]
<Drup>
jpdeplaix: are you really surprised that llvm is an optimizing compiler ? :D
wwilly has joined #ocaml
<wwilly>
bonjour
<Drup>
flux: since you're enthousiastic about, you can explain it to me : why not lwt or async ?!
<Drup>
about it*
divyanshu has joined #ocaml
maattdd has joined #ocaml
rand000 has quit [Ping timeout: 240 seconds]
maattdd has quit [Ping timeout: 240 seconds]
AeroNotix has joined #ocaml
<flux>
well, lwt seems so much less nice than the Event-module. sometimes it's difficult to reason about its behavior. I can see that difficulty from others as well in some posts on the ocaml mailing list.
<flux>
I have not used Async, so I should.
<flux>
I actually have an Event-inspired module Msgqueue that implements the same and some additional functionality (timeouts..) but it has receive-buffers, that is, receiving/writing is not a synchronous operation.
<flux>
apparently this is not great from the theoretical point of view, but nice from practical ;)
divyanshu has quit [Ping timeout: 264 seconds]
<flux>
especially as the origins of the Event come from concurrent ml where the threads where garbage collected - they are not garbage collected in ocaml
<flux>
so it becomes a bit less nice to add some buffering threads, you need to manage them as well
<adrien>
and ocamlnet's Equeue?
<Drup>
which event's are you talking about ?
<flux>
I haven't used it. it deals with communication between threads as well?
<flux>
drup, "Event", you have it in ocaml ;)
<flux>
it's part of the threading sysetm
<flux>
but it's a bit neutered, as you can't really properly hook up things for it and implementing timeouts is hackish at best
<Drup>
oh right the "almost frp, but not really" interface to thread, yes
<Drup>
I would use Lwt+react instead of that.
<adrien>
flux: I think so
<flux>
adrien, well, haven't looked at that either
divyanshu has joined #ocaml
<flux>
I actually had a decent lwt-like version of the Msgqueue/Event but sadly it's owned by an ex employer
<Drup>
looking at the event module, I really think you could just use react
<Drup>
all the functions are there
<flux>
how about wrap and wrap_abort?
<Drup>
E.map
<flux>
wrap_abort?
<Drup>
I'm not sure, since I don't understand what means "but if it is not selected"
<flux>
well, let's say you have match select [launch_nuclear_missile; make_tee] with .. then if tee gets done first, you can make it to abort the nuclear missile launch
<Drup>
for this use case, Lwt.pick
darkf has quit [Read error: Connection reset by peer]
darkf has joined #ocaml
<flux>
yeah, with lwt I would select on threads. and I better make sure that if I use that kind of structure, I always create all the threads involved. I can't just use an old variable referring to a thread, because it would get aborted.
<jpdeplaix>
Drup: No, it's just that I didn't saw the result of the target dependent optimization (which does things like the optimizations related to alignments, et cetera), as it wasn't in the same module than the usual optimizations
shinnya has quit [Ping timeout: 240 seconds]
darkf has quit [Quit: Leaving]
|jbrown| has joined #ocaml
rand000 has joined #ocaml
struktured has quit [Ping timeout: 252 seconds]
brainacid has left #ocaml []
maattdd has joined #ocaml
struktured has joined #ocaml
fantasticsid has quit [Ping timeout: 252 seconds]
maattdd has quit [Ping timeout: 265 seconds]
|jbrown| has quit [Ping timeout: 252 seconds]
nojb`` has joined #ocaml
nojb`` has quit [Remote host closed the connection]
maattdd has joined #ocaml
divyanshu has quit [Ping timeout: 252 seconds]
|jbrown| has joined #ocaml
eizo has joined #ocaml
<bernardofpc>
>> "test" ;;
<bernardofpc>
>> let test = "test"
<bernardofpc>
This is a >> test ;;
divyanshu has joined #ocaml
tani has joined #ocaml
tane has quit [Ping timeout: 264 seconds]
<AeroNotix>
>> 1 + 1;;
<bernardofpc>
>> (+) 1 1 ;;
<Drup>
It's a bit broken :p
<AeroNotix>
:)
<bernardofpc>
right, we're only the testers :D
ontologiae has quit [Ping timeout: 264 seconds]
avsm1 has quit [Quit: Leaving.]
knz has left #ocaml []
maattdd has quit [Ping timeout: 240 seconds]
<whitequark>
jpdeplaix: I'm glad you found it useful
<whitequark>
you can perform LTO as much times as you want, in principle. Note that there is an "internalize" pass which marks all functions except "main" internal, which gives the optimizer permission to rip them out
<Drup>
(quick note whitequark, you should ask op's for the bot, it was proposed earlier and decided against it :p)
fantasticsid has joined #ocaml
<Drup>
ops*
<Drup>
also, on the feature side, I think it's completly useless if it doesn't behave exactly as a toplevel
<whitequark>
Drup: (ops) well, I've asked publicly in the channel... ping mrvn ?
<whitequark>
(toplevel) this thought has crossed my mind.
<Drup>
I didn't see you asked, I must have missed it :p
<Drup>
ops are mrvn and adrien, afaik
<whitequark>
I think I could make use of linux's seccomp
<ggole>
AeroNotix: what's the actual error?
<Drup>
xenocons: what are the "Yield" and "Use" supposed to do ?
<Drup>
oh, yield is just return
struktured has quit [Ping timeout: 240 seconds]
ollehar has quit [Ping timeout: 252 seconds]
ollehar has joined #ocaml
maattdd has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
cesar_ has joined #ocaml
cesar_ is now known as Guest92946
Smerdyakov has joined #ocaml
Guest92946 has quit [Remote host closed the connection]
maattdd has joined #ocaml
philtor has joined #ocaml
fantasticsid has quit [Ping timeout: 252 seconds]
ikaros has quit [Quit: Ex-Chat]
ollehar has quit [Ping timeout: 252 seconds]
tautologico has joined #ocaml
S11001001 has joined #ocaml
S11001001 has quit [Changing host]
S11001001 has joined #ocaml
tlockney_away is now known as tlockney
dapz has joined #ocaml
Anarchos has joined #ocaml
rgrinberg has joined #ocaml
divyanshu has quit [Quit: Computer has gone to sleep.]
Hannibal_Smith has joined #ocaml
mcclurmc has joined #ocaml
Rotacidni has quit [Ping timeout: 255 seconds]
ollehar has joined #ocaml
struktured has joined #ocaml
mcclurmc has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
mcclurmc has quit [Client Quit]
NoNNaN has joined #ocaml
tobiasBora has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
S11001001 has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
maattdd has quit [Ping timeout: 252 seconds]
dsheets has quit [Ping timeout: 252 seconds]
HoloIRCUser2 has joined #ocaml
HoloIRCUser2 is now known as __obad___
Rotacidni has joined #ocaml
rgrinberg has joined #ocaml
tlockney is now known as tlockney_away
tlockney_away is now known as tlockney
passiveobserver has quit [Quit: EliteBNC free bnc service - http://elitebnc.org - be a part of the Elite!]
passiveobserver has joined #ocaml
ikaros has joined #ocaml
jonludlam has joined #ocaml
passiveobserver has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
tlockney is now known as tlockney_away
lordkryss has joined #ocaml
passiveobserver has joined #ocaml
maattdd has joined #ocaml
tani has quit [Quit: Verlassend]
eizo has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
nikki93 has joined #ocaml
Hannibal_Smith has quit [Quit: Sto andando via]
<Drup>
question to people who hacked into the parse tree : why is there a contstructor "Lapply" in the ADT for long indents ?
<whitequark>
Make(Foo)
<tizoc>
there is no way using stdlib's Hashtbl to do `try Hashtbl.find t s with Not_found -> Hashtbl.add t s v; v` in one step right? (I want to avoid the need to hash twice, while also maintaining the original value if it exists)
<whitequark>
tizoc: nope
<Drup>
whitequark: that's was my first though, but is it possible to do M(A).x ?
<kerneis>
tizoc: is there any reason why you want to maintain the original one?
eizo has joined #ocaml
<kerneis>
I can't think of a case where the difference would be observable, but I must be missing something
<kerneis>
oh wait, i'm stupid
<kerneis>
if the value already exists, you don't want to replace it
<kerneis>
because it might be a new value
<tizoc>
kerneis: I'm using identity to compare equality
<tizoc>
(this is a symbols table)
<Drup>
tizoc: BatHashtbl.modify_opt
<whitequark>
>> module M(X: sig end) = struct let x = 1 end;; M(struct end).x
<tizoc>
thats why I want to keep the original
<whitequark>
apparently not
<tizoc>
Drup: ah ok, will check batteries
<Drup>
whitequark: so it's a bit weird to have that directly in Longident.t
<tizoc>
thanks everyone
<whitequark>
Drup: no clue
<Drup>
It's when things are not available that you realize how much you're dependent on them : I want merlin for 4.02 :(
<whitequark>
port it!
<whitequark>
also, are you working on the lwt syntax thingy? :)
<Drup>
yes
shinnya has joined #ocaml
<whitequark>
awesome, I'm going to need it soon
<Drup>
have to look at the documentation a lot for now, so it goes quit slowly
* whitequark
is hacking on ocaml-sodium
<Drup>
quite*
<Drup>
even without the quotation, the code is smaller than the camlp4 version ...
<whitequark>
have you published it yet?
<Drup>
no no, I just started this afternoun, It's not working at all for now :D
<whitequark>
I was more thinking along the lines of reading and/or contributing to it
<Drup>
wait tomorrow :)
malc_ has quit [Quit: leaving]
<Drup>
I'm wondering if "let rec%lwt" would make sense
<Drup>
probably not with the easy transformation
<whitequark>
um, it definitely doesn't
Smerdyakov has quit [Quit: Leaving]
<whitequark>
you can't define functions with lwt x = y, and recursive immutable structures are best left unmentioned
<Drup>
whitequark: it's not possible now, yes
HoloIRCUser has joined #ocaml
__obad___ has quit [Ping timeout: 276 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
lostcuaz has joined #ocaml
maattdd has quit [Ping timeout: 252 seconds]
rgrinberg has quit [Quit: Leaving.]
Rotacidni has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
Rotacidni has joined #ocaml
Submarine has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 276 seconds]
shinnya has quit [Ping timeout: 240 seconds]
axiles has quit [Remote host closed the connection]
<Drup>
whitequark: huum, I'm not sure where should I report attributes in "let%lwt[@foo] ..."
<whitequark>
report?
<Drup>
well, I'm not gonna just discard them
<Drup>
hu, report is not the good verb, damn french
<whitequark>
well, they are discarded by default. you aren't introducing anything unexpected
<whitequark>
perhaps just attach them to underlying let ?
<whitequark>
err fun
<Drup>
well, there are various possibilities
<Drup>
1) the underlying lets (there is not only one)
<Drup>
2) the Lwt.bind applications
<Drup>
2) the funs
<whitequark>
more than one let?
<Drup>
in case of "lwt ... and ..."
<Drup>
hum, actually, only one let, put multiple bindings
<Drup>
but*
<whitequark>
I don't think let%lwt translates even into a single let
<Drup>
it does
<Drup>
for now, I attach everywhere :]
steshaw1 has joined #ocaml
wwilly has quit [Quit: This computer has gone to sleep]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
tlockney_away is now known as tlockney
<whitequark>
ha
rand000 has quit [Quit: leaving]
jonludlam has quit [Ping timeout: 240 seconds]
divyanshu has joined #ocaml
HoloIRCUser2 has joined #ocaml
tlockney is now known as tlockney_away
HoloIRCUser has quit [Ping timeout: 240 seconds]
Simn has quit [Quit: Leaving]
<AeroNotix>
is there any way to stop needing to put semicolons inside lists?
<AeroNotix>
seems superfluous
<AeroNotix>
(and tuples)
<mrvn>
without it would be function calls
<AeroNotix>
good point
<AeroNotix>
ok
<mrvn>
for lists you can use ::
<AeroNotix>
indeed
eizo has quit [Ping timeout: 240 seconds]
<mrvn>
The pages about crt* should have that too. You just don't have seperate crt* objects for your kernel.
<mrvn>
ups#
<Drup>
AeroNotix: [ x1 ; x2 ; x3 ] <- where is the ; superfluous ? :)
<AeroNotix>
Drup: yeah I was tripping
Rotacidni has quit [Ping timeout: 265 seconds]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<_obad_>
anyone got experience with ocaml on arm? specifically, cross-compiling, buildroot, that kind of stuff.
<_obad_>
I managed to get ocamlbrew to compile a good opam subset on debian armel, but now I want to see if I can cross-compile things instead.
<_obad_>
(I was using qemu)
<_obad_>
and "managed" is an overstatement, it just worked flawlessy on its own with the proper dependencies installed.
<nicoo>
_obad_: I know nothing about cross-compiling OCaml applications and am mildly tipsy, so don't ask me for advise ;)
clan has joined #ocaml
tlockney_away is now known as tlockney
lordkryss has quit [Quit: Connection closed for inactivity]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
ggole has quit [Ping timeout: 276 seconds]
nikki93 has quit [Remote host closed the connection]
rgrinberg has quit [Quit: Leaving.]
<_obad_>
fuck this shit. I don't really need to cross-compile. I just need a build that uses uclibc. so my problem is now this: get a gcc using uclibc on debian armel.
<xenocons>
Drup: re yield+use yes, you are right, use is for stuff that is disposable, after the function exits scope, cleanup is performed, kinda like python 'with open(file,...'
<Drup>
so completly useless in ocaml
<xenocons>
yeah id say so
<xenocons>
yield however isn't
<xenocons>
especially in terms of enumerations
<Drup>
what is it for ?
<Drup>
the document I read speak about the way computational expressions are expanded, but not about the semantic
<xenocons>
2 places i see it used are sequences and async(comp expressions)
<xenocons>
[for c in 'a'..'z' do yield c ]
<xenocons>
(or you can use -> short hand)
<xenocons>
advantage is that it doesnt return elemens you dont want
<Drup>
that's just return
lostcuaz has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<xenocons>
(i haven't really used it outside of list comp :\)
<Drup>
what is the semantic of yield! ? :)
<xenocons>
i have used 'return!' and 'return' in async exps a lot though
<xenocons>
specification just says yield! yields a computation :9
<Drup>
I field like running in circle
<Drup>
feel*
<Drup>
:(
<xenocons>
just a bit
<xenocons>
its mostly invisible to me
<xenocons>
[ for i in 0..5 -> i ] is using yield
<xenocons>
[for i in 0..5 do if i <> 2 then yield i ] also, but explicit
<xenocons>
`yield!` can be used to combine sequences to a final result..
<xenocons>
as far as semantics go i have nfi how to explain it
darkf has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
<Drup>
my first question was : is there a difference between yield and return ?
<Drup>
apparently, no.
<xenocons>
semantically? perhaps not
<xenocons>
but in terms of language keywords, cant use return like a yield
<mrvn>
doesn't return stop the loop or something?
<Drup>
xenocons: why ?
<Drup>
xenocons: oh, return is a keyword in F# ?
<xenocons>
(infact there is no actual return keyword outside of comp exprs afaik)
<xenocons>
yeah
<xenocons>
only for async i have ever used it
<Drup>
yeah, doesn't matter for us
<xenocons>
can ocaml use return inside comprehensions
<whitequark>
there's no return in ocaml
<Drup>
there is no comprehension in ocaml
<xenocons>
what about Enum? that looks like sequences to me
<xenocons>
(batteries)
<Drup>
Enum is just a data structure
<Drup>
(and a bad one)
<mrvn>
Didn't x86 have more differences depending on wether you came from user or kernel mode?
<mrvn>
ups, ewin
<xenocons>
ah i see
<xenocons>
yield seems useful especially for people who write imperative code
<whitequark>
mrvn: what is that channel you constantly struggle to send a message to?
<Drup>
xenocons: you have some syntax extension for comprehension, but it's not in ocaml
<xenocons>
Drup: i see
<xenocons>
i will miss that, i love my ghetto for loops :)
<xenocons>
but i suppose you can initialise a list then map over it which is in essence the same thing... now
<whitequark>
comprehensions are hardly necessary in ocaml
<Drup>
xenocons: in OCaml, and as far as I can see, yield is specifically used for .. yielding, in the context of concurency libraries
<xenocons>
on that note, F#'s comprehensions are really inefficient
<Drup>
(in Lwt; yield : unit -> unit Lwt.t)
<xenocons>
as in, it uses a sequence behind the scenes, then toArray\toLists it depending on the initialiser
<xenocons>
usually chokes big data
<xenocons>
Drup: right
<xenocons>
yeah
claudiuc has joined #ocaml
<tautologico>
comprehensions aren't strictly necessary, but they can make some code clearer
<xenocons>
one thing i note about ocaml is that parallel constructs are really obscure
<xenocons>
tautologico: correct
<Drup>
and for asynchronous concurency libraries, return is used
<xenocons>
but there is an efficiency hit with them
<Drup>
xenocons: well, there are no parallel constructs so ...
fraggle_ has quit [Ping timeout: 255 seconds]
madroach has quit [Ping timeout: 252 seconds]
<xenocons>
Drup: e.g. (and im not being a fanboy here) if i want to perform a function over an array in parallel, i just change Array.map to Array.Parallel.map, itd be cool if batteries had that
<tautologico>
F# comprehensions may be slow, that doesn't mean comprehensions are always slow
<whitequark>
xenocons: Lwt has that
<tautologico>
for multicore parallelism, F# is in a much better position than OCaml
<Drup>
tautologico: it's not hard :D
<tautologico>
in OCaml you have to deal with processes
<xenocons>
ahh so lwt?
<xenocons>
tautologico: correct
<tautologico>
but will lwt threads run in different cores?
<xenocons>
but ocaml is in a better position in terms of xplat maturity (except windows)
<Drup>
xenocons: if you want true parallelism, you have Parmap to do this // map
madroach has joined #ocaml
<xenocons>
parmap? hmm
<xenocons>
whats the state of lwt?
<Drup>
if you want concurent "parallel" mapping, yeah, lwt.map_p
<tautologico>
OCaml and F# are in kind of mirrored situation
<xenocons>
or lwt <> parmap?
<tautologico>
regarding platforms
<xenocons>
tautologico: haha yeh
<Drup>
lwt <> parmap
<xenocons>
k
<Drup>
lwt is very solid
<xenocons>
k
<tautologico>
F# is good on Windows, getting better elsewhere but most users are still on Windows so few people care about other platforms
<xenocons>
ill be checking that out
<xenocons>
tautologico: yep
<tautologico>
OCaml is good on unixes and most users are on unixes so few people care about windows
<Drup>
xenocons: but it's *concurent* asynchronous library, no parallelism whatsoever
<xenocons>
Drup: aha! an important difference
<xenocons>
(however one i still need to refer back to someones blog to re-understand)
fraggle_ has joined #ocaml
<Drup>
parmap is a very kiss library to do // map or fold on big arrays
nikki93 has joined #ocaml
<Drup>
but it's quite heavy weigth, since it's forking
<Drup>
(it's basically a local map reduce)
<xenocons>
hmm interesting
<xenocons>
ill check it out later, day stuff to do
<Drup>
There is parmap like integrated into Async, iirc
<Drup>
(Async being the other concurrent asynchronous library)
NoNNaN has quit [Remote host closed the connection]
steshaw1 has quit [Quit: Leaving.]
<Drup>
whitequark: I'm a bit confused by something in the lwt syntax extension
NoNNaN has joined #ocaml
<Drup>
raise_lwt is translated to "Lwt.fail (try raise $e$ with exn -> exn)" is "debug" is on and "Lwt.fail $e$" otherwise
<Drup>
and I'm not sure I understand the difference :|
<Drup>
is it just a trick to appear in the backtrace or something ?
<whitequark>
it is
divyanshu has quit [Quit: Computer has gone to sleep.]
<Drup>
I see
ikaros has quit [Quit: Ex-Chat]
<Drup>
make sense
<Drup>
huho, raise is not a keyword
<Drup>
well, no raise%lwt
<whitequark>
you can translate raise_lwt calls though
<Drup>
apparently it as always been the case. For some reason I was convinced that raise was a keyword
<whitequark>
assert is, though!
<whitequark>
I was confused by this too
<mrvn>
Drup: raise is a special function
<whitequark>
mrvn: a special one?
<Drup>
well, it seems quite hard to implement in pure ocaml :)