studybot has quit [Remote host closed the connection]
hhugo has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
pyon has quit [Remote host closed the connection]
hhugo has joined #ocaml
hhugo has quit [Read error: Connection reset by peer]
hhugo has joined #ocaml
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
eikke__ has joined #ocaml
pyon has joined #ocaml
shinnya has quit [Ping timeout: 245 seconds]
dapz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Moataz-E has quit [Quit: Leaving]
<BitPuffin>
I'm a bit confused
<BitPuffin>
what does module type meon
<BitPuffin>
and what would happen if you didn't assign a sig
<whitequark>
it would get inferred from the struct
<BitPuffin>
well how does a module type differ from a module
<BitPuffin>
I like how real world ocaml just went you can do this: ... without explaining what it means
<Drup>
BitPuffin: modules are structurally typed by their content.
hhugo has quit [Quit: Leaving.]
<Drup>
BitPuffin: type "module M = List" in the interpreter, it will show you the type
<BitPuffin>
ah
<BitPuffin>
and what's spat out of that is something I could have put in a sig and done module M: L = List
<Drup>
yes
Lutin` has quit [Read error: Connection reset by peer]
<BitPuffin>
and then L would have to be a "module type"
<Drup>
yes
<BitPuffin>
I think I kind of grok I guess
<Drup>
"module type" and "signature" are the same thing
<BitPuffin>
yeah so I guess the form module M : sig ... end = struct ... end syntax is in a way sugar that let's you make an anonymous module type
<BitPuffin>
although sugar is the wrong way
<BitPuffin>
are module types and module structures in different namespaces?
<BitPuffin>
or "can I call a module type the same thing as a module without name clash"
waern has joined #ocaml
WraithM has quit [Ping timeout: 260 seconds]
<Drup>
yes
<BitPuffin>
okay
<BitPuffin>
fair enough
q66 has quit [Quit: Leaving]
<BitPuffin>
my my this module system seems very powerful so far
<BitPuffin>
I'm especially very fond of the local open stuff
struktured has quit [Ping timeout: 240 seconds]
agarwal1975 has joined #ocaml
struktured has joined #ocaml
studybot has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
penglingbo has joined #ocaml
waern has quit [Ping timeout: 245 seconds]
ygrek has joined #ocaml
Lutin` has joined #ocaml
Lutin` has quit [Ping timeout: 265 seconds]
Lutin` has joined #ocaml
jpdeplaix has quit [Ping timeout: 240 seconds]
Eyyub has quit [Ping timeout: 265 seconds]
jpdeplaix has joined #ocaml
Lutin` has quit [Read error: Connection reset by peer]
dapz has joined #ocaml
Eyyub has joined #ocaml
Don_Pellegrino|l has joined #ocaml
jao has quit [Ping timeout: 276 seconds]
BitPuffin has quit [Ping timeout: 260 seconds]
poindontcare has quit [Remote host closed the connection]
limbopeng has joined #ocaml
penglingbo has quit [Ping timeout: 240 seconds]
BitPuffin has joined #ocaml
Eyyub has quit [Ping timeout: 265 seconds]
mcclurmc has joined #ocaml
Don_Pellegrino|l has quit [Quit: Konversation terminated!]
ontologiae has joined #ocaml
racycle_ has quit [Quit: ZZZzzz…]
ygrek has quit [Remote host closed the connection]
ontologiae has quit [Ping timeout: 265 seconds]
mcclurmc has quit [Remote host closed the connection]
divyanshu has joined #ocaml
skchrko has quit [Remote host closed the connection]
demonimin has quit [Remote host closed the connection]
demonimin has joined #ocaml
ygrek has joined #ocaml
struktured has quit [Ping timeout: 240 seconds]
_tca has quit []
slash^ has joined #ocaml
axiles has joined #ocaml
Simn has joined #ocaml
Cyanure has joined #ocaml
<BitPuffin>
does functional updates on records make a full copy of the record you are basing off or does it "point" to the old fields in the base for those you don't update?
<adrien>
{ some_record with field = value } is only one allocation
<BitPuffin>
for that field only?
<BitPuffin>
or does it make an entirely new field
<BitPuffin>
er
<BitPuffin>
record
<adrien>
i.e. it allocates the record, copies the pointers in the record except for the changed one
<adrien>
it cannot do otherwise
robink has quit [Remote host closed the connection]
<BitPuffin>
so it is still pointing to the same memory then?
<adrien>
all the fields in the record? yes
<BitPuffin>
except for the new field
<BitPuffin>
ah
lordkryss has joined #ocaml
<BitPuffin>
cool
<BitPuffin>
that's what I was hoping
<BitPuffin>
I've been meaning to try doing something like that in C++ for a game engine
<BitPuffin>
but now that I'm writing ocaml I might as well try it out with records maybe
<BitPuffin>
:)
<Simn>
What about mutable fields?
<BitPuffin>
gets icky in a multithreaded context
robink has joined #ocaml
<Simn>
I meant how the copying behave.
<BitPuffin>
oh
<BitPuffin>
I see
<BitPuffin>
good question
<adrien>
copied
<adrien>
hmmm
<adrien>
I was using ints which isn't a good idea I think
<BitPuffin>
adrien: by value?
<adrien>
ints will always be copied
<adrien>
but I've tried with an int list and it appears to be copied too
<BitPuffin>
ah
<adrien>
errr, hold
<adrien>
on
<adrien>
still too early in my morning, I think I've done something wrong
<adrien>
right, _not_ copied
<adrien>
so mutable doesn't change the behaviour wrt 'with'
<Iluvatar593>
so, forgetting about tail recursion for a moment, must i use the cons val defined in the signature on the match of the append instead of :: ?
<companion_cube>
do you necessarily require the underlying type to be a list?
<companion_cube>
it could be a tree of lists, for easier append
<Drup>
(tree of list is bad, I tried)
<Drup>
(well, it's better than list, but *anything* is better than lists)
<Iluvatar593>
lol, so i think you was sarcastic XD
<Iluvatar593>
i'm not a very good english speaker
<Drup>
Iluvatar593: what you did is fine.
<Iluvatar593>
however, does it answers to your question if i necessarily require the underlying type companion_cube ?
<Iluvatar593>
or with underlying type you mean something else?
<companion_cube>
well, you have an abstract signature with an abstract type
<Kakadu>
Iluvatar593: You are very lucky that OCaml is mentioned in some Universities in your country
<companion_cube>
you can use any type you want to implement it, in general, and that can be more subtle than list
<def`>
Kakadu: you didn't had functional programming courses in your university :( ?
<companion_cube>
well I only had one course in OCaml, and it wasn't about FP (compiler course)
<Iluvatar593>
i know Kakadu
<Kakadu>
def`: I had but I met OCaml two years before
<def`>
so that's fine :)
<Iluvatar593>
here in Pisa the department have a quite theoretical imprinting
<Iluvatar593>
so they focus a lot on functional programming
<Kakadu>
We had one course about FP in Haskell on the 5th year of studying but I think that after 4 years of university almost all minds are poisoned by OOP and new Algol
<Iluvatar593>
ocaml is the first language they teach on the first cours of programming!
<Iluvatar593>
*course
<def`>
Kakadu: oh, I had the same problem. it took me two or three attempts to recover from OOP poisoning
<Kakadu>
Nice. On 1st semester we was studying Pascal...
boogie has joined #ocaml
<Iluvatar593>
I think is a good approach, if we're speaking of computer scientist
<Iluvatar593>
*scientists
<Iluvatar593>
In Italy we can leave that Imperative-OOP poisoning to Computer Engineers
rgrinberg has joined #ocaml
<Iluvatar593>
I was told that in other countries the difference is not so marked
<def`>
I started as computer engineer… the oop brainwashing is terrible.
<companion_cube>
it's sad that there is such a wide gap
<Kakadu>
What job your post-graduaters usually do?
<companion_cube>
a post-doc.
<companion_cube>
:DDDD
<Iluvatar593>
hahha exactly
<Kakadu>
Iluvatar593: ^
<Kakadu>
ah
<Kakadu>
I need to fix auto scroll in IRC web client!
<Iluvatar593>
if they don't want to do shitty jobs who can be done by high school kids or less qualificated people
<Kakadu>
btw
<Iluvatar593>
or leave Italy...
<def`>
Iluvatar593: I am not sure there is a promised land… shitty jobs in IT are everywhere
maattdd has joined #ocaml
<Kakadu>
Iluvatar593: When you say to engineers that FP is very nice and useful does they look at you like you are idiot or freak?
<Iluvatar593>
well, i don't have yet a very clear vision about that, that's my master degree last year, but the impression is that in Italy there are very few companies who really exploit your knowledge and don't simply need programming monkeys
eikke__ has quit [Ping timeout: 276 seconds]
slash^ has joined #ocaml
<Iluvatar593>
Kakadu, yes, something like that
<Iluvatar593>
:)
<Iluvatar593>
It has to be said that i'm the first that doesn't want to continue studying, but rationally speaking about didactics FP is really useful
<Drup>
Iluvatar593: afaict, that's everywhere
Anarchos has joined #ocaml
<Iluvatar593>
well, i return for a moment to my boring question XD
<Iluvatar593>
so, in the first recursive implementation of append
<Iluvatar593>
have i written something compatible with the list defined in the previous exercise?
<Iluvatar593>
(my doubt is about using :: in matching instead of the cons i defined)
<Drup>
your doubt is correct
emias has joined #ocaml
<Iluvatar593>
and why the funk when i write the module type on ocaml
<Iluvatar593>
than if i try to use it says unbound module?
<def`>
you defined a module type, not a module
<def`>
(sig vs struct)
jwatzman|work has joined #ocaml
<Iluvatar593>
...
<Iluvatar593>
i'm an idiot
<Iluvatar593>
sorry, too many degrees to study XD
<Iluvatar593>
is there a keyword for optional fields in module types?
<Drup>
no
testcocoon has quit [Ping timeout: 240 seconds]
arjunguha has joined #ocaml
<Iluvatar593>
how can i use in matching
<Iluvatar593>
my defined empty list?
<def`>
you can't
<Iluvatar593>
:(
<Iluvatar593>
so if i want to write an append func that has type 'a Mylist.mylist -> 'a Mylist.mylist -> 'a Mylist.mylist
<Iluvatar593>
what can i do?
<Kakadu>
destructing list with hd or tl?
<def`>
yep
seanmcl has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
seanmcl has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
SethTisue has quit [Quit: SethTisue]
mcclurmc has quit [Remote host closed the connection]
SethTisue has joined #ocaml
olauzon has joined #ocaml
Hannibal_Smith has joined #ocaml
SethTisue has quit [Client Quit]
Eyyub has joined #ocaml
watermind has joined #ocaml
SethTisue has joined #ocaml
<Tekk_>
I'm having some issues with the unix api. I'm trying to do a simple test with pipes but I always get an invalid argument exception whenever I try to do any reading or writing
<whitequark>
it allows to implement a subset of camlp4
<whitequark>
much cleaner
<whitequark>
well, technically compiler-libs allow to manipulate code as data, but for syntactical reasons it isn't as useful as in lisp
<def`>
nothing significant about homoiconicity. you might want to look at meta-ocaml
<hinzelmann>
I never heard it, should look
ygrek has quit [Remote host closed the connection]
agarwal1975 has joined #ocaml
<def`>
hinzelmann: be aware that it is a research project though
<hinzelmann>
But as an experimental idea, how about make ASTs simpler as an abstract lamda calculus expression then convert it Lisp then converting it again OCaml? Could it work in theory?
<def`>
I can't really tell but it seems you lose a lot of information through these transformations.
<def`>
The AST is not complicated for the sake of being complicated (it is quite reasonable actually), it carries a lot of information
<Drup>
hinzelmann: I'm very impatient to see your transformation from modules to simply typed lambda calculus :3
<def`>
Drup: -dlambda :P
<Drup>
def`: dlambda is a bit more than simply typed lambda calculus