MrScout_ has quit [Read error: Connection reset by peer]
Rebelion has joined #ocaml
MrScout has quit [Ping timeout: 244 seconds]
struktured has joined #ocaml
dav has quit [Ping timeout: 255 seconds]
dav has joined #ocaml
travisbrady has quit [Quit: travisbrady]
struktured has quit [Ping timeout: 244 seconds]
travisbrady has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
rgrinberg has joined #ocaml
dav has quit [Ping timeout: 245 seconds]
jao has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
shaykha has joined #ocaml
govg has quit [Ping timeout: 264 seconds]
gdsfh1 has quit [Ping timeout: 264 seconds]
alkoma has joined #ocaml
MrScout has joined #ocaml
MrScout has quit [Remote host closed the connection]
jao has joined #ocaml
jao has quit [Ping timeout: 256 seconds]
travisbrady has quit [Quit: travisbrady]
oscar_toro has quit [Ping timeout: 255 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
moei has quit [Quit: Leaving...]
gdsfh has joined #ocaml
marynate has joined #ocaml
rgrinberg has quit [Ping timeout: 264 seconds]
thomasga has quit [Quit: Leaving.]
jao has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
jao has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
alkoma has quit [Remote host closed the connection]
funtik_ has quit [Remote host closed the connection]
kapil__ has joined #ocaml
funtik_ has joined #ocaml
jao has joined #ocaml
jao has quit [Ping timeout: 244 seconds]
darkf has joined #ocaml
govg has joined #ocaml
anemator has joined #ocaml
anemator has quit [Client Quit]
ygrek has joined #ocaml
jao has joined #ocaml
badkins has joined #ocaml
MrScout_ has joined #ocaml
MotorMe has joined #ocaml
MrScout_ has quit [Remote host closed the connection]
t4nk495 has quit [Ping timeout: 246 seconds]
jao has quit [Ping timeout: 255 seconds]
vanila has joined #ocaml
mcc has joined #ocaml
q66 has quit [Quit: Leaving]
nojb has joined #ocaml
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 244 seconds]
badkins has quit []
rgrinberg has joined #ocaml
MrScout_ has joined #ocaml
MrScout_ has quit [Read error: Connection reset by peer]
MrScout_ has joined #ocaml
MrScout_ has quit [Ping timeout: 256 seconds]
rgrinberg has quit [Quit: Leaving.]
samrat has joined #ocaml
natrium1970 has joined #ocaml
<natrium1970>
I have a question about modules, signatures, and hiding. One book gives an example: module type GENSYM = sig … end. Then module Gensym : GENSYM = struct … (* Only stuff declared in GENSYM will be visible from outside *) end.
<natrium1970>
That works fine if GENSYM and Gensym are in a single file, but the file itself acts as a module, so GENSYM and Gensym are submodules of whatever file they’re in. What if I wanted to put GENSYM in GENSYM.mli and Gensym.ml so that I didn’t have the extra layer of module? Because the Gensym = module struct … end is implicit by placing it in its own file, there’s no place to put an equivalent to Gensym : GENSYM.
<natrium1970>
In other words, how do I put a signature constraints on a top-level module?
nojb has quit [Quit: nojb]
<whitequark>
so in module M : S = I, S is the contents of the mli file, and I is the contents of ml file
<whitequark>
you could either put the contents of module type GENSYM in the mli file, or include GENSYM there
<natrium1970>
So if I wanted module GensymOne and GensymTwo, each in a different file, and both constrained to GENSYM, there’s no easy way to do that?
<whitequark>
as I've said, you can do include GENSYM
<whitequark>
as in, not textually include, just write "include GENSYM"
<whitequark>
or rather, "include X_intf.GENSYM", where X_intf is some other file defining GENSYM
rgrinberg has joined #ocaml
ggole has joined #ocaml
<whitequark>
Tekk_: even with cstubs, you need to recite a enum entirely
mcc has quit [Quit: This computer has gone to sleep]
<natrium1970>
Ah. Okay. Thanks. This seems to be made more complicated by the way OCaml implicitly wraps module struct around .ml file and sigantures around .mli files. That’s kind of confusing me. A lot of languages require you to say MODULE Blah = …. even though the filename is Blah.m3.
enitiz has quit [Ping timeout: 264 seconds]
<natrium1970>
I’m trying to figure out some of this with books I’ve found on OCaml, but some of the books are out of date. Like one says that OCaml lacks first-class modules, which it apparently did lack at the time the book was written
<vanila>
I think real world ocaml is pretty modern, thats what im learning form
<natrium1970>
Yeah, but I’m trying to avoid Core, which is (no pun intended) pervasive in that book.
<vanila>
hahaha
<natrium1970>
Bcause Core does not play nice with js_of_ocaml.
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
<natrium1970>
I know the simple stuff that doesn’t involve modules or objects from one of my courses.
natrium1970 has quit [Quit: natrium1970]
ygrek has quit [Ping timeout: 252 seconds]
govg has quit [Ping timeout: 245 seconds]
malc_ has quit [Quit: leaving]
rgrinberg has quit [Quit: Leaving.]
fafounetbis has joined #ocaml
shaykha has quit [Ping timeout: 252 seconds]
rgrinberg has joined #ocaml
keen__________27 has joined #ocaml
keen__________26 has quit [Ping timeout: 244 seconds]
fafounetbis has quit [Ping timeout: 256 seconds]
zwer_w has joined #ocaml
zwer has quit [Ping timeout: 250 seconds]
moei has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
Pepe_ has quit [Ping timeout: 264 seconds]
kakadu has joined #ocaml
govg has joined #ocaml
govg is now known as Guest27395
Guest27395 has quit [Client Quit]
hekmek has joined #ocaml
MercurialAlchemi has joined #ocaml
MotorMe has quit [Remote host closed the connection]
martintrojer has quit [Ping timeout: 245 seconds]
chinglish has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
martintrojer has joined #ocaml
samrat has joined #ocaml
Yoric has joined #ocaml
samrat has quit [Quit: Computer has gone to sleep.]
AltGr has left #ocaml [#ocaml]
slash^ has joined #ocaml
paolooo_ has joined #ocaml
paolooo_ has quit [Client Quit]
paolooo has joined #ocaml
mort___ has joined #ocaml
paolooo has quit [Client Quit]
marynate has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 245 seconds]
contempt has quit [Remote host closed the connection]
<badkins>
Which is: let rec factorial : int -> int = function .... any ideas why that's not recommended ?
<Drup>
because he's an haskellist and using haskell's idioms, I suppose
<badkins>
As a newbie, I thought that form seemed pretty good if you knew you were going to pattern match.
<Drup>
That's how I would write it, minus the type annotation
<mrvn>
let ocaml figure out the types.
<mrvn>
I don't like when people write: let fac x = match x with ...
<badkins>
sure - I typically don't annotate types - he was just showing the full syntax for comparison
<badkins>
I did learn about OCaml's guards from the article - it doesn't seem to be mentioned in RWO for some reason.
<Drup>
it's a bit weird to show plenty of OCaml syntax and only one Haskell syntax, while you can perfectly write functions in plenty of different ways in haskell too ...
<Drup>
ahah, this page is so obviously written by an haskell person :D
<ggole>
I don't think Andreas Rossberg is a Haskell guy
<Drup>
well, he tries very hard to be neutral without really succeeding.
<Drup>
ggole: I'm talking about the previous link, not the sml/ocaml one
<ggole>
Oh right, never mind then
<mrvn>
When switching from ocaml to C++ I always want to write: auto foo(auto x, auto y) { return x + y; }
<whitequark>
have you seen the last mail on caml-list
<Drup>
?
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 240 seconds]
Muzer has quit [Ping timeout: 264 seconds]
marynate has quit [Quit: Leaving]
shaykha` has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
jgjl has quit [Ping timeout: 256 seconds]
<mrvn>
whitequark: ?
<mrvn>
Subject: [Caml-list] Ocaml programmers interested in human-level AI
<mrvn>
?
<ousado>
LOL human-level AI
<whitequark>
yep
<Drup>
oh, I just skipped "human-level" and just read "AI"
<whitequark>
"we have a startup working on that subject"
<whitequark>
it's hysterical
<cmtptr>
what do you guys tend to use to build ocaml projects? ocamlbuild is not intuitive to me at all. is it sacreligious to just write my own makefile?
<mrvn>
When I write an AI why would I want to limit it to be as stupid as a human? :)
<mrvn>
cmtptr: _oasis
<mrvn>
cmtptr: whatever you do use ocaml findlib
<cmtptr>
thanks
Muzer has joined #ocaml
rgrinberg has quit [Quit: Leaving.]
matason has joined #ocaml
badon has quit [Ping timeout: 250 seconds]
struktured has joined #ocaml
Haudegen has quit [Ping timeout: 265 seconds]
badon has joined #ocaml
<ggole>
whitequark: tell them to ask it to write a decent build system
<whitequark>
lol
<adrien>
Drup: Andreas' Rossberg page has been around for a looooooooong time
<adrien>
ah, hadn't seen the previous one :)
<adrien>
also, for the last mail on the ML, it's not the first time I find the author "bold"
<Drup>
adrien: again, I was not talking of this page.
<adrien>
yeah, saw that a bit after :P
<adrien>
you're similar to Str in usage actually :)
<Drup>
:<
<whitequark>
wow rude
<whitequark>
ggole: ... I actually did
<ggole>
Haha
<ggole>
This can't possibly end well
<Drup>
:D
<ggole>
The robot revolution will begin when they realise we're asking them to do the impossible
<adrien>
:)
<adrien>
ggole: that'll keep them busy
<struktured>
whitequark: human-level AI is probably supposed to be "strong" AI
<struktured>
but yeah it sounds incredibly sophomoric
<whitequark>
typical silly valley arrogance, too
<whitequark>
struktured: someone on twitter suggested "strongai.ly"
mort___ has quit [Quit: Leaving.]
<ggole>
There's interesting recent progress in fields like image recognition
<ggole>
But what a sad load AI has been over the years
<whitequark>
i'm wondering how much of that progress can be attributed to moore's law
<whitequark>
google used how many machines, 8k?, for their cat picture recognizer?
<struktured>
ggole: the funniest part is how AI is kinda going in circles. we are back to deep neural networks, 15 years later
Haudegen has joined #ocaml
<ggole>
I don't know enough to say whether it's the latest tricks that have done it
<Drup>
struktured: that's the whole storry of compsci (or even science in general). Nothing surprising here.
<whitequark>
ggole: I do recall a few tricks, but I feel like the whole second coming of AI is kind of overrated.
<whitequark>
same old story, a few orders of magnitude cheaper CPU time
<ggole>
We'll see
<ggole>
And not from the startups, I suspect
<struktured>
whitequark: AI is not just optmization, it's all policy / control theory with imperfect information and minimal resources
<whitequark>
sure
<struktured>
*all/also
<struktured>
Drup: ha but one not cyclical similar thing I see is AI and machine learning are basically applications of apparently useless math established 50-500 years ago
<Drup>
that's ... also very cyclical..
<struktured>
Drup: well its not the same state because now we can exercise dusty math papers with fancy computer simulations
<Drup>
sure
<Drup>
but I mean, it's also exactly what's happening in science in general all the time
<Drup>
someone invents something
<Drup>
it's deemed completely impossible to use or useless at the time
<Drup>
and someone exhumes it 20 to several hundred of years later because it's now useful/practical with modern methods.
<struktured>
indeed
<cmtptr>
is it common practice to put ;; on a line by itself, or do people generally thing this is ugly?
<Drup>
it's ugly and useless :p
NoNNaN has quit [Quit: []]
tnguyen has joined #ocaml
<mrvn>
cmtptr: never put ;; in a file. That's just for interactive typiong
<cmtptr>
aren't there cases where you have to?
<mrvn>
no
Hannibal_Smith has joined #ocaml
<cmtptr>
well alright then!
psy__ has joined #ocaml
<ggole>
Yes, but those are never necessary.
<mrvn>
There are cases though where it gives errors
<Drup>
whitequark: he answered seriously ._.
psy__ has quit [Client Quit]
psy_ has quit [Quit: Leaving]
hekmek has joined #ocaml
matason has quit [Ping timeout: 265 seconds]
psy_ has joined #ocaml
<cmtptr>
er, no composition operator? how do I write partial application like "print_endline . to-string"?
<cmtptr>
that is, "let print_expr = print_endline . to_string"
<Drup>
cmtptr: let print_ext x = print_endline @@ to_string x
<mrvn>
cmtptr: let print_expr e = Printf.printf "\n%s%!" (to_string e)
<cmtptr>
so in other words, you just don't, I guess. fair enough, thanks
<Drup>
mrvn: if you go this way, use %a ;)
<mrvn>
cmtptr: make your own: let (@@@) f1 f2 x = f1 (f2 x)
<mrvn>
Drup: can I pass to_string to %a?
<whitequark>
Drup: I think I started the most ridiculous thread of the year
<whitequark>
well, not started
<cmtptr>
ah, cool. haven't gotten far enough to have seen the definition of infix functions yet
nojb has joined #ocaml
<Drup>
mrvn: sure
<Drup>
at least if you are rendering to a string
<Drup>
ah, maybe only for asprintf, not printf
<mrvn>
Drup: "%a" (fun out x -> print_string (to_string x))?
<Drup>
meh, Print is annoying, I prefer Format, it's more consistent
<whitequark>
ugh, ignoring "out"
<Drup>
mrvn: no, that's the worst idea you could come up with.
<Drup>
yeah, ok, you can't give to_string directly, even with sprintf
<Drup>
(as I said, meh Print)
<mrvn>
Drup: "%a" (fun out x -> Printf.kfprintf out ((to_string x)) to be correct. I prefer %s
<Drup>
yeah
<mrvn>
(+ the missing args)
<Drup>
Libraries should provide a pp function anyway :>
<mrvn>
fun out x -> output_string out (to_string x) is simpler, but still way more than %s
<dmbaturin>
Speaking of that, what exactly are existential types?
rock_neurotiko has quit [Ping timeout: 264 seconds]
mengu has quit []
oscar_toro has quit [Ping timeout: 240 seconds]
jonludlam has quit [Quit: Coyote finally caught me]
NSA360 has joined #ocaml
rgrinberg has joined #ocaml
BitPuffin has quit [Ping timeout: 264 seconds]
travisbrady has quit [Ping timeout: 255 seconds]
<Drup>
MisaMisa: so, to answer your question, there are various design decision in Haskell that I don't like and that, imho, make programming in it unnecessary hard.
<Drup>
1) reasoning about performances in haskell is hard, because of lazyness and typeclass and the whole optimization framework based on rules (when they don't apply, your performances suck really badly).
<Drup>
2) I don't like restrained side effects with monads. algebraic effects are much better but if I have to choose between monads and nothing, I prefer nothing.
<MisaMisa>
hmm...
<Drup>
3) Typeclasses, as implemented in Haskell, present a set of issues that makes the code hard to read.
<Drup>
4) I don't like the tendency of the haskell community to play type riddles.
<Drup>
that includes the recent trend of transforming GHC Haskell in a dependently typed language.
<Drup>
(there are various other points that makes me prefer OCaml, like the fact that records are much better, that I like OCaml's functors, that OCaml has various possibilities to do subtyping and that js_of_ocaml is very good :p)
<NSA360>
Hi. Im trying to make a log parser in ocaml. Its been hard to understand but i did already the lexer and the parser and it went well, but... without an ast. can you help me how can i do that? I guess its very simples but... :/
<dmbaturin>
A tiny points that annoys me in haskell: in ocaml REPL you can enter any program that can be fed to compiler, in GHCi it's not the case. :)
<dmbaturin>
* point
<Tekk_>
dmbaturin: how does that work?
<Drup>
NSA360: what is the question ? ^^
* Tekk_
has never seen the limitations of ghci
<dmbaturin>
NSA360: What did you use for the lexer and parser?
<Tekk_>
I've never really messed with haskell to begin with actually
<NSA360>
ocamllex and ocamlyacc
<Drup>
oh, also, in the whole ocaml vs haskell : merlin is much better than ghc-mod :D
<Drup>
(and cabal is terrible terrible terrible)
<dmbaturin>
Tekk_: Well, haskell function-level pattern matching uses multiple lines (as in "length [] = 0 \n length (x:xs) = 1 + length xs". GHCi doesn't recognize this as a single function if you enter it line by line (unless I'm missing some trick for it).
<NSA360>
The question is: how can i make an ast tree for this grammar [S [TittleA MultipleLinesA] [TittleB MultiplesLinesB] [TittleC MultiplesLines C ] [TittleD MultiplesLines D] ]]
<Tekk_>
dmbaturin: ah
<Drup>
NSA360: you just did ? ^^
<dmbaturin>
Tekk_: Also, GHCi requires that all expressions are prefixed with "let", while compiler doesn't support this syntax, so you can't just paste into REPL from source file and back.
<Drup>
NSA360: what is the output of your parser at the moment ?
<MisaMisa>
dmbaturin: you need to wrap your input with :{ and :}
<Drup>
unhappy smiley and happy smiley
<MisaMisa>
so I was just curious about the difference between two programming languages; the answer I received are beyond my expectations...
nojb has joined #ocaml
nojb has quit [Client Quit]
<Drup>
ah, I though you wanted something opinionated :D
<MisaMisa>
Drup: maybe I would be able to answer my own question after learning ocaml.
kotee has left #ocaml [#ocaml]
<Drup>
sure
<Drup>
I didn't know if I would like haskell before I used it a bit.
nojb has joined #ocaml
nojb has quit [Client Quit]
<pippijn>
Build:
<pippijn>
ghc --make file.hs
<pippijn>
ocamlopt -o file file.ml
<pippijn>
not quite
<pippijn>
that's just for a single file
<MisaMisa>
maybe I need to clarify this: I did not ask the question in this channel. my friend (who is an ocaml enthusiast) posted it here then I came to read your replies to him.
travisbrady has joined #ocaml
jao has joined #ocaml
<dmbaturin>
I certainly don't regret learning about both.
<badkins>
I do miss list comprehension syntax a bit from Haskell, but the "eager", modules, tooling, I/O, Unix compatibility, etc. are nice in OCaml IMO
jprakash has quit [Ping timeout: 264 seconds]
Haudegen has quit [Ping timeout: 264 seconds]
<thizanne>
you can actually use syntax extensions if you want list comps in OCaml
<Drup>
yeah, there is a list compression camlp4 extension
<badkins>
cool - where do I go to get started?
<Drup>
comprehension*
<Drup>
badkins: camlp4 manual.
<Drup>
(huhuhu)
<badkins>
thx
tane has quit [Quit: Verlassend]
nicoo has quit [Remote host closed the connection]
Haudegen has joined #ocaml
nicoo has joined #ocaml
asakim has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
t4nk975 has quit [Ping timeout: 246 seconds]
MercurialAlchemi has quit [Ping timeout: 264 seconds]
NSA360 has quit [Ping timeout: 255 seconds]
kakadu has quit [Remote host closed the connection]