<adrien>
I've started looking at atd-gen ( http://mylifelabs.github.com/atdgen-tutorial.html ) ; it parses a file in the "atd" syntax and can produce OCaml types; the atd syntax is quite close to ocaml's and I think I could use atd-gen to make it easier and more reliable to create C code
<adrien>
C stubs
<adrien>
which is my idea of turning "type t = { a:int; b:int}" into T_A = 0, T_B = 1 on the C side so you don't have to remember and check the field numbers
lopexx has joined #ocaml
joewilliams has quit [Max SendQ exceeded]
bobry has quit [Ping timeout: 276 seconds]
lopexx has quit [Client Quit]
lopex has quit [Excess Flood]
lopex has joined #ocaml
lopex_ has joined #ocaml
lopex has quit [Client Quit]
lopex_ is now known as lopex
Submarine_ has quit [Ping timeout: 260 seconds]
Submarine_ has joined #ocaml
Submarine_ has quit [Changing host]
Submarine_ has joined #ocaml
pyiretr has quit [Ping timeout: 240 seconds]
joewilliams has joined #ocaml
bobry has joined #ocaml
<adrien>
in my program, I use types "Gtk.Tags.position", "Zipper.where_add", "Zipper.where_remove"; and I'm going to use many more types that come from libraries
<adrien>
I can have (de)serializers for json, s-expressions, and other for the code of my current program but I can't have them for the library types
<adrien>
and I don't want to add code myself since I'll have many many other types in the near future
<adrien>
any advice on the approach I could take?
asdfhjkl has joined #ocaml
<adrien>
that's something Marshal works well for =/
The_third_man has quit []
<adrien>
hmmm, runtime types
The_third_man has joined #ocaml
ankit9 has quit [Quit: Leaving]
Drup has joined #ocaml
fantasticsid has joined #ocaml
Cyanure has joined #ocaml
ikaros has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
fraggle_ has quit [Remote host closed the connection]
fraggle_ has joined #ocaml
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
ttamttam has joined #ocaml
The_third_man has quit [Ping timeout: 252 seconds]
The_third_man has joined #ocaml
Metazzuri has joined #ocaml
Metazzuri has left #ocaml []
MaskRay has quit [Quit: leaving]
letrec has quit [Remote host closed the connection]
ttamttam has left #ocaml []
roha has quit [Ping timeout: 276 seconds]
<adrien>
hnrgrgr: hi, you work on ocaml-ty, right? are there code examples which are available somewhere?
roha has joined #ocaml
<adrien>
and I'm not sure I get the relation between ocaml-ty and Alain Frisch's proposal and presentation: are they basically the same thing?
<thelema>
adrien: they look the same to me
<thelema>
if it were suficiently easy to switch out of -ty, I
<thelema>
d use it for my coding
<adrien>
well, right now, I think that I _NEED_ -ty
<thelema>
let me know how stable it is
<hnrgrgr>
adrien: no more example yet than: testsuite/tests/lib-dyntypes/test.ml
<adrien>
sure;
<adrien>
hnrgrgr: looking at it, thanks
<adrien>
should be enough to satisfy my curiosity :-)
<hnrgrgr>
And it's not written as readable examples... the initial "module rec" is not mandatory to use type expression. :)
<adrien>
thought it was weird :-)
<adrien>
but I'm trying to get a rough idea
oriba has joined #ocaml
<adrien>
I have options and a description of these options (and I want to keep both separate, I think); I don't know if I want to move to -ty or if I should stay on my current system (I'm parsing the description and use with Obj to do what I need [ the structure says String/Enum/Int/... ])
<adrien>
-ty looks nice and usable; now, is it stable and is it likely to get merged before 2015?
antegallya1 has joined #ocaml
antegallya has quit [Disconnected by services]
antegallya1 has quit [Client Quit]
antegallya has joined #ocaml
pilki has joined #ocaml
antegallya has quit [Client Quit]
antegallya1 has joined #ocaml
antegallya1 is now known as antegallya
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
antegallya1 is now known as antegallya
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
antegallya1 is now known as antegallya
antegallya1 has joined #ocaml
antegallya has quit [Disconnected by services]
antegallya1 has quit [Client Quit]
antegallya has joined #ocaml
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
antegallya has joined #ocaml
antegallya1 has quit [Read error: Connection reset by peer]
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
antegallya has joined #ocaml
antegallya1 has quit [Read error: Connection reset by peer]
antegallya has quit [Client Quit]
antegallya1 has joined #ocaml
antegallya1 is now known as antegallya
antegallya1 has joined #ocaml
antegallya has quit [Read error: Connection reset by peer]
antegallya1 is now known as antegallya
roha has quit [Ping timeout: 244 seconds]
antegallya has quit [Ping timeout: 245 seconds]
antegallya has joined #ocaml
antegallya has quit [Ping timeout: 260 seconds]
EmmanuelOga has joined #ocaml
roha has joined #ocaml
antegallya has joined #ocaml
antegallya has quit [Client Quit]
cyphase has quit [Ping timeout: 252 seconds]
antegallya has joined #ocaml
antegallya has quit [Client Quit]
antegallya has joined #ocaml
antegallya has quit [Quit: Leaving.]
antegallya has joined #ocaml
cyphase has joined #ocaml
antegallya has quit [Read error: No route to host]
antegallya has joined #ocaml
antegallya has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has quit [Ping timeout: 248 seconds]
ftrvxmtrx has quit [Ping timeout: 248 seconds]
ftrvxmtrx has joined #ocaml
antegallya has joined #ocaml
roha has quit [Ping timeout: 260 seconds]
roha has joined #ocaml
djcoin has joined #ocaml
<djcoin>
Oh my god. Ocaml is awesome. Labels ?! Fuck Yeah
simbhar has joined #ocaml
<djcoin>
Sorry :s
<djcoin>
Just starting Ocaml, wanted to learn some functionnal language, Erlang (read a book), Haskell ? Ocaml (learnt caml at university)
<simbhar>
Please may someone explain to me what "as" is doing here: "| Apply (Fun (f, x, _, _, e) as v1, v2) -> ..." (I've omitted the wider context)
<djcoin>
I started some Haskell to tutorial yet keeping an eye on ocaml
<djcoin>
and I think i will stick to ocamll
<thelema>
simbhar: binding part of the expression to an identifier
<simbhar>
thelema, I assume v1 <- f and v2 <- x? I'm not sure how to parse it :(
<simbhar>
I found the caml docs a little terse on the matter for my level.
<thelema>
simbhar: match Apply (Fun (1,2,3,4,5), 6) with Apply (Fun (f,x,_,_,e) as v1, v2) results in:
<thelema>
f=1, x=2, e=5, v2=6, v1=Fun(1,2,3,4,5)
<simbhar>
thelema, ahh, that makes sense. Thank you!
<thelema>
djcoin: great. I hope you enjoy OCaml lots
<djcoin>
Well, I'm good at Python and JavaSCript too, C and such, Im curious about language and always liked to learn, discover then. But I was looking to dive more in the functional paradigm, and OCaml which seems as fast as C++, functionnal etc. seems future proof. Make it an awesome language!
<djcoin>
Yet, I dont know if I will get hired to program in ocaml :s
<djcoin>
s/then/them/
<simbhar>
I heard that quite a lot of financial institutions use caml, at least. Can't find the link right now...
<thelema>
simbhar: jane street?
<simbhar>
thelema, that's the one!
<djcoin>
(not so good at C, I meant, I like those. Ps: sorry for non sense sentence, I think Im getting overly excited :) )
<djcoin>
Yep, and heard of mylife (or something like that ?)
<simbhar>
djcoin, but I think you should approach a new language to learn about new ways to think/approach problems, rather than for job prospects.
<thelema>
yup, mylife too
<djcoin>
simbhar: yeah
<djcoin>
But I like to get excited in my daily job
<simbhar>
That's why I'm learning caml
<djcoin>
I'm a bit bored about my daily python programming. Even if it s a great language
<djcoin>
thelema: thanks for your welcome message :)
<djcoin>
It s been 2 or 3 times I am trying to dive into ocaml. But I think Im hooked for good now
<djcoin>
I was *
<thelema>
djcoin: spread your enthusiasm - the ocaml ecosystem is hitting a very big improvement right about now - automated package installation and many compiler improvements
<djcoin>
simbhar: yeah I do agree with you
<djcoin>
Thats why I was wondering about going even more functionnal
<djcoin>
with haskell
<djcoin>
TO dive into all those cutting edge paradigm
<simbhar>
I found Haskell's purity somewhat frustrating, a great experience, don't get me wrong, but I prefer the balance caml has struck.
<wut__>
is ocaml the future?
<thelema>
wut__: maybe. I'm working to make it a strong contender
<simbhar>
thelema, is there a roadmap of the compiler improvements planned available online somewhere?
<wut__>
I read an article about ocaml in the communications of the acm a couple months ago
<wut__>
the one by jane street capital's chief engineer
<wut__>
and it got me interested
<thelema>
simbhar: I think there was some plans in Xleroy's talk at the last ocaml meeting, let me see if I can find
<thelema>
wut__: ocaml is a great language, and yarron is a effective advocate for it.
<simbhar>
thelema, cheers, that's some cool stuff!
<thelema>
this isn't the official repo, just my git mirror of the official svn
<djcoin>
What does this repo of yours really is ? Will it be merged back in the official svn ?
<djcoin>
Thanks for the link
<thelema>
djcoin: this repo was a very old (c. 2008, iirc) fork of ocaml trying to integrate some of the patches that were floating around. That has been abandoned and now it's just a git mirror.
<thelema>
mirror of the main development branch
<simbhar>
It would be very nice to see lightweight processes in the ocaml implementation, something akin to Erlang's actors.
<pilki>
for lightweigth threads, you have lwt
<thelema>
simbhar: pretty unlikely; xleroy is pretty committed to running only on a single core.
<djcoin>
simbhar: coroutines or such ?
<pilki>
(but I guess it's not what you are asking for)
<pilki>
thelema : not true :)
<simbhar>
pilki, no :)
<djcoin>
thelema: as a git mirror, you actually push to svn rather than to the github repo ?
<thelema>
pilki: really? I've seen more than a decade of people asking for multicore ocaml, and xavier telling them to use processes for parallelism because shared memory doesn't scale
<pilki>
yes, he thinks (rightfully) that shared memory sucks and would like to have a better model
<pilki>
but would still like to have a multicore gc
<thelema>
djcoin: The OCaml compiler development isn't quite open enough for me to be involved. They push to SVN, I checkout their SVN and push to github
<simbhar>
Seems more of an implementation issue than Xavier's opinion of shared memory from that post.
<thelema>
pilki: and unless someone can do this without sacrificing any single-threaded performance and having maintainable code, it's not going to happen
<djcoin>
I read a post with him saying: use messages implies your code scale to cluster -> multicore with memory sharing is not as usefull . (may not be exactly that)
<djcoin>
useful*
<thelema>
djcoin: yup, he's espoused that.
<pilki>
I love the caml mailing list archives
<pilki>
where you don't have the date
<pilki>
blah
<djcoin>
thelema: yeah that what I was wondering, it is pretty closed :| Not sure its good for the language/community. Do you manage to get your changes merged back in svn ?
<djcoin>
was what I was wondering*
<thelema>
djcoin: no changes I've made to the compiler have been merged back in svn.
<simbhar>
pilki, it's 2002
<pilki>
thanks simbhar
<pilki>
I guess the multi-core landscape has evolve a bit since then
<simbhar>
yeah
<djcoin>
thelema: so you are maintining a real fork ? That may never be merged in the original repo ?
<simbhar>
:)
<djcoin>
Too bad
<thelema>
djcoin: not maintained - abandoned.
Cyanure has quit [Ping timeout: 265 seconds]
<djcoin>
Does anyone programm in ocaml for its leaving ?
<thelema>
for its leaving?
<pilki>
uhuh
<pilki>
living ;)
<djcoin>
living *
<djcoin>
:>
<djcoin>
Sorry !
* pilki
is not :(
<thelema>
not I.
* pilki
is programming in java/C++
<pilki>
(suxx to be me)
mfp has quit [Read error: Connection reset by peer]
<djcoin>
Maybe web framework will help. I guess suggesting replacing the python (django/pyramid) stack to ocsigen may not convince my boss and colleagues :\
<companion_cube>
o/ djcoin
<djcoin>
companion_cube: hey !
<companion_cube>
pilki: not even Haskell? :p
<djcoin>
pilki: too bad, you should give a try to python. It has some functional parts and begin to be wieldy used. Not sure if its a great advice.
<companion_cube>
nah, pilki is a crusader of static typing
<djcoin>
Im okay with that :)
<adrien>
I've enjoyed COBOL
<adrien>
you should give it a try
<thelema>
<bonk>
* simbhar
stabs adrien
<adrien>
heh!
<adrien>
it's great for at least 2 minutes and at most 3 =)
<simbhar>
That's a very generous lower bound.
<companion_cube>
O'Cobol
<companion_cube>
the purely functional object oriented jvm-based cobol
<simbhar>
^
<thelema>
IronCobol
<simbhar>
haha
<djcoin>
adrien: damn, I'm wounded from having to learn that
<djcoin>
Makes me angry
<djcoin>
(I meant I had to learn it)
<adrien>
more seriously, I tried cobol not very long ago
<adrien>
found it somehow fun because it was new and weird
<adrien>
and then
<adrien>
I wondered if I could spend even one day doing cobol
<adrien>
it's hard to describe the feelin
<pilki>
companion_cube : I would rather use C++ than Haskell on a day to day basis :)
<adrien>
g
<pilki>
at least you can do something else that intellectually masturbate yourself on how great your monad transformers are :-D
<adrien>
I loved that quote, partly because it's from 2009: A ‘newbie’, in Haskell, is someone who hasn’t yet implemented a compiler. They’ve only written a monad tutorial.
<simbhar>
pilki, heh, I got that impression. The Haskell core is fantastically beautiful, but Monads + unsafePerformIO just make everything nasty imo
<companion_cube>
pilki: you're really a troll :D
<simbhar>
I'm not an expert, so maybe I just don't get it
<adrien>
I get angry at people who want purity _everywhere_ ='(
<companion_cube>
(and people on #haskell rather talk about zygoprepromorphisms)
<simbhar>
Me too
<pilki>
companion_cube : are you discovering that ? :-D
<companion_cube>
no.
<pilki>
good :p
<companion_cube>
but really, C++ after coq...
<pilki>
everyone has a price
<simbhar>
hehe
<pilki>
mine was reached :)
<simbhar>
You slut :P
<pilki>
yop :-D
<pilki>
whore, to be semantically precise
<companion_cube>
peripateticien
<pilki>
ta guele sale pute
<pilki>
:p
<companion_cube>
hey
<pilki>
whatever !
<pilki>
yeah, I know, coq/caml would have been great and everything
<companion_cube>
so how do you like segfaults?
<pilki>
companion_cube : I'm currently mostly reading java code so no segfault
<pilki>
just some head banging
<simbhar>
Java was my price ;)
<companion_cube>
pilki: at least try to introduce some scala
<pilki>
when I see let f = List.map g written in 11 lines
<simbhar>
I consider myself a high-class escort
<pilki>
but well
<pilki>
I'm still not sure I like scala though
<pilki>
I have to think about it more
<pilki>
yeah yeah, it's functionnal
<pilki>
but it's too implicit for me
<simbhar>
I currently leaning toward Clojure in that battle.
<companion_cube>
like C++ is not implicit
<pilki>
to much "don't worry, we are doing it for you" things to make me happy
<companion_cube>
you can use scala as a better, slightly functional java
<pilki>
oh, it is, and I hate that :)
<adrien>
ocamljava.x9c.fr
<adrien>
you can progressively replace all the java components with ocaml ;-)
* adrien
kicks ohloh in the nuts
<pilki>
yeah, they won't notice
<adrien>
well, it'll be faster and more reliable; they might think that something is happening
cyphase has quit [Read error: Connection reset by peer]
<pilki>
I don't think that ocaml compiled to java bytecode will be "faster"
<companion_cube>
no tail rec
<companion_cube>
don't forget about multithreading, though
<adrien>
pilki: higher-level optimizations :-)
<pilki>
sure...
Drup has quit [Quit: Leaving.]
<adrien>
well, a couple hours ago, I was talking with some good C coders; they use arrays and lists :-)
<companion_cube>
the good argument for ocaml is readability because of the size of the code
<adrien>
their only excuse is that they're doing embedded
<companion_cube>
lists? in C, it's already heresy
<djcoin>
Hu ? Why ? Seems perfectly normal
<pilki>
stop it companion_cube :)
<adrien>
companion_cube: with macros
<companion_cube>
I prefer inline functions
<companion_cube>
I know some C programs with advanced data structures, though
<companion_cube>
like splay trees
<adrien>
I know some C with green threads too
<adrien>
very performant ones
<adrien>
iirc, 700 lines of awful code
<pilki>
<companion_cube> I prefer inline functions <--- you can't define a datastructure (like list) with inline functions...
<pilki>
I think trolling on Haskell is more fun
<pilki>
C is just too easy :)
<companion_cube>
oh, I misunderstood
<adrien>
pilki: I know a couple of tasks that you definitely don't want to do in ocaml
<companion_cube>
C is still awesome for tight control :p
<adrien>
like drawing
antegallya has quit [Ping timeout: 245 seconds]
<pilki>
drawing what?
<pilki>
sheeps? :)
antegallya has joined #ocaml
<adrien>
for instance ;-)
pilki is now known as SaintEx
<SaintEx>
why not?
<SaintEx>
you can just call draw_box()
SaintEx is now known as pilki
<adrien>
hahah :-)
* pilki
tired
<adrien>
pilki: I mean: doing the low-level stuff with bits
<djcoin>
lol
<adrien>
(not bytes)
<companion_cube>
yeah, like tagged pointers
_habnabit has quit [Ping timeout: 245 seconds]
_habnabit has joined #ocaml
<pilki>
sure, I'm not saying OCaml should take over the world and we should program micro controller with it
<pilki>
just that when I see that people are still programming entire systems, graphical interfaces, logics, etc etc
<pilki>
in C
<pilki>
bah...
<companion_cube>
for logics I understand why, now :)
<adrien>
pilki: you can use ocaml bytecode on PIC18 ;-)
<pilki>
when I say logics, I don't mean Logic, I mean "what the program is doing"
<pilki>
adrien: you *can*, but should you? :)
<thelema>
type ('a, 'b) printer = 'b output -> 'a -> unit
<thelema>
How do I get rid of the 'b in this?
<thelema>
I want to have `int printer` mean `'a output -> int -> unit`
antegallya has quit [Ping timeout: 245 seconds]
mjonsson has joined #ocaml
<companion_cube>
pilki: true then
<pilki>
thelema : context ?
antegallya has joined #ocaml
<thelema>
pilki: batteries has a standard printing function format: 'a output -> foo -> unit, where foo is the type to be printed
<thelema>
I want to name this as a type, so that I can write 'a printer -> 'a list printer
<thelema>
instead of ('a output -> 'b -> unit) -> 'a output -> 'b list -> unit
<companion_cube>
then you have to pickup a specific output, don't you?
<thelema>
I have ('a, 'b) printer now, but want to have this type match any output without lifting that into the name
<thelema>
almost always the output will be unit output, but to print to a string, you write to a string output, and you get the string when you close that output.
<thelema>
I'd prefer not to use a record to encode the forall
<pilki>
what is the meaning of this 'a output ?
<thelema>
(which I think is valid), as this would screw up the usage.
<pilki>
the 'a is weird
<thelema>
`'a output` is an output channel that returns a value of type 'a when closed.
<thelema>
for example, string output instead of a buffer
<pilki>
oh ok
<pilki>
ah, Hindly Milner polymorphism
<pilki>
Y U SO POOR?
<thelema>
I guess I'll have to live with ('a,_) printer -> ('a list,_) printer
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
edwin has quit [Remote host closed the connection]
pilki has quit [Quit: This computer has gone to sleep]