<Smerdyakov>
I bet everyone here already knows about that book.
<Smerdyakov>
It's almost five years old, in case you didn't notice. :P
<pattern>
yeah, i know everyone knows about
<pattern>
it
<pattern>
i was just pointing out that fp is getting some attention from the mainstream
<Smerdyakov>
Huzzah!
<pattern>
:)
<pattern>
i see ocaml's been mentioned a lot in the high scored messages in that thread
mimosa has quit ["J'ai fini."]
LittleDan has joined #ocaml
<LittleDan>
How can you use optional arguments for functions in OCaml?
<Riastradh>
OCaml has a 'label' system that's a really hackily ugly kludge. In general, 'don't.'
<mellum>
Riastradh: well, some people seem to like it
LittleDan has left #ocaml []
gim has quit ["bonne nuit"]
<mattam_>
i like it. There are cool shortcuts for ~ and ?
mattam_ is now known as mattam
<Nutssh>
I like labels, when I have a function accepting a lot of arguments. I don't think optional arguments are as nice.
<Riastradh>
If OCaml's records were anonymous and could have default field values, there would be no necessity for any sort of 'optional/label argument' facility.
<mattam>
Riastradh: maybe, what languages have that feature ?
<pattern>
you know where to send patches ;)
<mattam>
scheme maybe ...?
<Riastradh>
mattam, SML, I believe.
<mattam>
oh
<Riastradh>
No, Scheme uses lists for arguments, not currying or tuples.
<mellum>
Riastradh: isn't that an implementation detail? I don't see why scheme couldn't pass arguments as tuples
<Riastradh>
mellum, tuples are fixed-size; you can't have 'rest tuples.'
<Nutssh>
I believe the argument against that was that since records are explicit, you know what type of variable must be bound to a particularily named field. And there can be no name collisions within a program. (name meaning the fully qualified module.name)
<mellum>
does anybody know a good algorithm to calculate modulus on a CPU without such a instruction? One that does not work bit-by-bit?
<Riastradh>
Nutssh, yes, it requires changes to OCaml's record system.
<Nutssh>
And not superficial ones.
<mattam>
it's only a type-checking issue, isn't it ?
<Nutssh>
I don't know all the details. I suspect its deeper than you think.
<Riastradh>
Yeah, so I'll just use Scheme.
<Nutssh>
I've considered heading to common lisp myself.
<Smerdyakov>
mellum, I remember implementing this for my TI-86 in assembly. The details are not fresh in my mind, but you can just use "grade school long division" in binary.
<Smerdyakov>
mellum, maybe this is the "bit-by-bit" that you don't like.
<Nutssh>
Look at how GCC implements it in its library mod64vi or something like that.
cjohnson has quit ["Drawn beyond the lines of reason"]
The--Fixer has joined #ocaml
srv has quit [Read error: 110 (Connection timed out)]
The-Fixer has quit [Connection timed out]
The--Fixer has quit ["Goodbye"]
The-Fixer has joined #ocaml
srv has joined #ocaml
jdmarshall has joined #ocaml
buggs^z has joined #ocaml
buggs has quit [Read error: 60 (Operation timed out)]
Nutssh has joined #ocaml
shawn_ has joined #ocaml
jdmarshall has quit [Remote closed the connection]
jdmarshall has joined #ocaml
kinners has joined #ocaml
Nutssh has quit [Read error: 110 (Connection timed out)]
jdmarshall has quit ["Out of steam."]
kinners has quit ["leaving"]
jave_work has joined #ocaml
jave_work has quit [Remote closed the connection]
lam has quit [Read error: 104 (Connection reset by peer)]
lam has joined #ocaml
__DL__ has joined #ocaml
__DL__ has quit [Client Quit]
_shawn has joined #ocaml
kinners has joined #ocaml
shawn_ has quit [Read error: 110 (Connection timed out)]
mimosa has joined #ocaml
gim has joined #ocaml
kinners_ has joined #ocaml
kinners has quit [Read error: 60 (Operation timed out)]
karryall has joined #ocaml
whiskas has joined #ocaml
The-Fixer has quit ["Goodbye"]
The-Fixer has joined #ocaml
Demitar has joined #ocaml
wazze has joined #ocaml
Demitar has quit [Remote closed the connection]
Demitar has joined #ocaml
whiskas has quit ["Pa / Bye."]
mimosa has quit ["J'ai fini."]
emomisy has joined #ocaml
cjohnson has joined #ocaml
emomisy has quit [Read error: 110 (Connection timed out)]
emomisy has joined #ocaml
derfy has joined #ocaml
shawn_ has joined #ocaml
kinners_ has quit ["leaving"]
cjohnson has quit ["Drawn beyond the lines of reason"]
_shawn has quit [Read error: 110 (Connection timed out)]
shawn_ is now known as shawn
bk|afk has joined #ocaml
shawn_ has joined #ocaml
shawn has quit [Nick collision from services.]
shawn_ is now known as shawn
The-Fixer has quit ["Goodbye"]
wilcox has joined #ocaml
wilcox has quit ["Lost terminal"]
tacodog has joined #ocaml
The-Fixer has joined #ocaml
_JusSx_ has joined #ocaml
karryall has quit ["home"]
myrkraverk has joined #ocaml
myrkraverk has left #ocaml []
derfy has quit []
<_JusSx_>
lll
lam has quit [Read error: 110 (Connection timed out)]
emomisy has quit ["Leaving"]
bk|afk has quit ["I'll be back"]
lam has joined #ocaml
<Maddas>
Smerdyakov!
<Maddas>
Smerdyakov: Are you around?
<Maddas>
How unreliable! Not there when you need him. :-)
* Demitar
gives Maddas a sacrificial voodoo chicken.
* Maddas
is afraid to do anything with it and lets it go
<slashvar[lri]>
oh, common, don't be so shy
<slashvar[lri]>
;)
<Maddas>
I'll end up killing it accidentally. Or it will kill me if I try anything. I'm not good with animals
<mattam>
Maddas: why do you need Smerdyakov ?
<Maddas>
I'm wondering about his work :-)
<mattam>
about TAL & all ?
<Maddas>
yeah
<Maddas>
'What is TAL' is one :-)
<Maddas>
oh, I found something by guessing assembly right.
<drworm>
"This expression has type Syntax.decl but is here used with type string * Syntax.exp" -- well string * Syntax.exp _is_ one of Syntax.decl's types -- i realize i have to coerce it, but how? i could deconstruct the string * Syntax.exp and then make a Syntax.decl out of that, but that's so ugly...
<mattam>
one of ? maybe you forgot a constructor somewhere
<drworm>
i realize i phrased that poorly :)
<mattam>
Maddas: typed assembly language, which permits verifying nice invariants on generated code.
<Maddas>
Hmm
maihem has joined #ocaml
<drworm>
match ... with ... | DeclList (s, e, t) -> find (decl_of_acc acc s e) t mark <-- the "t" is what creates the error
<Maddas>
If you implement an algorithm for a mathematical problem in something like TAL, could you reason about solutions of the problem itself by reasoning about that program?
<mattam>
what's find type ?
<drworm>
mattam: right now it returns a function, but i'm not done with it... may be the culprit, hm
<mattam>
Maddas: i'm not sure. I think its more about veryfiyng a program can't crash/verify some semantics, not proving theorems.
<slashvar[lri]>
Maddas: I'm not sure, this is more the purpose of system such as Coq
<mattam>
;)
<Maddas>
ok
<Maddas>
so my plans to prove this theorem that so far no mathematicians could prove have been spoiled again
<slashvar[lri]>
Maddas: I don't realy know TAL, but somme assembly languages for VM are typed and the VM abstract interprete code for stack protection befor loading bytecode
<Maddas>
*mathematician
<Maddas>
:-)
<slashvar[lri]>
Maddas: have you tried Coq ?
<Maddas>
slashvar[lri]: oh, I don't know much maths
<Maddas>
:P
<mattam>
Maddas: what is your theorem ?
<mattam>
P = NP ?
<slashvar[lri]>
;)
<Maddas>
I don't have any yet!
<slashvar[lri]>
oh
<Maddas>
I just vaguely know of one problem that I could have thought of
<Maddas>
but I can't tell you mattam, or you'll use my great ideas to solve it before me.
<Maddas>
:-)
<slashvar[lri]>
Maddas: but, your idea of reasonning about the result of somme programm by reasonning on the program, is one of the things coq does
<Maddas>
ok, I'll keep it in mind next time I read things up, thanks
<Maddas>
I've heard of Coq before, never looked at what exactly it does, though
<slashvar[lri]>
(this how they prove and validate the proof of the 4-colors theorem ;)
<Maddas>
With Coq?
<slashvar[lri]>
(and also the cut elimination in ZF system)
<slashvar[lri]>
Maddas: yes
<Maddas>
slashvar[lri]: ooh, cool :-)
<Maddas>
(Hey, I even know the 4-colour theorem, if it's the thing with dividing the map.)
<slashvar[lri]>
(hum ... the one I remember is about 4-coloriability of planar graph, or something like that ... I'm not in graph theory at all)
<Maddas>
(Then, maybe I don't know it. Still is cool :-))
<Demitar>
Thos sound like the same thing. The map being the popular version and the graph being the mathematical version. :)
<slashvar[lri]>
;)
* Smerdyakov
is here!
<Demitar>
Eeep!
<Demitar>
Maddas, run!
* Maddas
& (running)
<Smerdyakov>
Did your desire to ask me something dissipate?
<Maddas>
Smerdyakov: I found the homepage of TAL, so yes
<tacodog>
i'm new to programming. is ocaml or haskell a good place to start?
<Maddas>
Actually, not really, but all questions I still have are questions of which I would not understand the answers.
<Smerdyakov>
I certainly recommend using Coq for proving theorems formally, also.
<Demitar>
tacodog, as good as any. If I was teaching I would teach either OCaml or python as a first language. (Then again I'm not.)
<tacodog>
yeah, i started with python. (i don't get paid for code so my schoolin' goes slow). I like python so far though
<Smerdyakov>
Demitar, you'd choose Python over Scheme?
<slashvar[lri]>
tacodog: here with we used to teach ocaml and pascal (hum ... ) as first languages
<slashvar[lri]>
and ocaml seems good for students so ...
<Demitar>
Smerdyakov, I don't know scheme, so without doubt, yes. :)
<tacodog>
cool. thanks
<Smerdyakov>
Demitar, I think your two proposed first languages represent a split between using statically or dynamically typed languages, and I think Scheme clearly dominates Python in the dynamic category.
cmeme has quit [Connection reset by peer]
<Demitar>
Smerdyakov, that may very well be (which I wouldn't know much about), but where I come from python is also used in real application whereas scheme is not (note that there isn't much use of scheme at all).
cmeme has joined #ocaml
<Demitar>
(That was quite flammable I guess. ;-)
_JusSx_ has quit [saberhagen.freenode.net irc.freenode.net]
tacodog has quit [saberhagen.freenode.net irc.freenode.net]
Hadaka has quit [saberhagen.freenode.net irc.freenode.net]
gl has quit [saberhagen.freenode.net irc.freenode.net]
wax has quit [saberhagen.freenode.net irc.freenode.net]
mellum has quit [saberhagen.freenode.net irc.freenode.net]
Hipo has quit [saberhagen.freenode.net irc.freenode.net]
Riastradh has quit [saberhagen.freenode.net irc.freenode.net]
<Maddas>
I don't think that matters much for teaching a language. In fact I'd say, it can be an advantage if you have students who all start at the same point.
_JusSx_ has joined #ocaml
tacodog has joined #ocaml
Hadaka has joined #ocaml
gl has joined #ocaml
wax has joined #ocaml
Riastradh has joined #ocaml
Hipo has joined #ocaml
mellum has joined #ocaml
<Maddas>
heh.
<Riastradh>
tacodog, no.
* Demitar
wonders what tacodog said during the netsplit.
<Riastradh>
tacodog, Scheme is a member of the family of languages called 'Lisp.' It happens to be very good for teaching computer science, but that is neither its sole purpose nor its sole use.
<tacodog>
ah, ok. thanks Riastradh
<Demitar>
I wonder how long ago I looked at OCaml in a similar way I apparently look at scheme now. :)
<tacodog>
and I'll take back all those things I said about Demitar
* Demitar
grins at tacodog.
Nutssh has joined #ocaml
gim has quit [Read error: 113 (No route to host)]
cjohnson has joined #ocaml
Hadaka has quit [saberhagen.freenode.net irc.freenode.net]
_JusSx_ has quit [saberhagen.freenode.net irc.freenode.net]
tacodog has quit [saberhagen.freenode.net irc.freenode.net]
gl has quit [saberhagen.freenode.net irc.freenode.net]
mellum has quit [saberhagen.freenode.net irc.freenode.net]
Hipo has quit [saberhagen.freenode.net irc.freenode.net]
wax has quit [saberhagen.freenode.net irc.freenode.net]
Riastradh has quit [saberhagen.freenode.net irc.freenode.net]
_JusSx_ has joined #ocaml
tacodog has joined #ocaml
Hadaka has joined #ocaml
gl has joined #ocaml
wax has joined #ocaml
Riastradh has joined #ocaml
Hipo has joined #ocaml
mellum has joined #ocaml
<drworm>
AAgh, i found my stupid problem after hours, it was all because of an optional argument, bah!
det has quit [saberhagen.freenode.net irc.freenode.net]
Vulpyne has quit [saberhagen.freenode.net irc.freenode.net]
buggs^z has quit [saberhagen.freenode.net irc.freenode.net]
<drworm>
o the wasted hours one has to go through to learn the subtleties of a new languages
<drworm>
-s
buggs^z has joined #ocaml
det has joined #ocaml
Vulpyne has joined #ocaml
<Riastradh>
Yuck. Just don't use optional arguments.
<Maddas>
drworm: I find it a good idea to avoid optional arguments as long as not necessary
<drworm>
we don't like optional arguments? :)
<Riastradh>
No!
<Maddas>
Nope
<Riastradh>
Optional arguments in OCaml are spawn of the devil!
<drworm>
i use them for nicer syntax for function callers -- recursive functions with accumulator options
<drworm>
foo a b instead of foo [] a b
<Maddas>
drworm: and end up with problems like these? :-)
<drworm>
Maddas: well i guess
<drworm>
but in this specific case, my accumulator isn't a list, but a data type imitating a list :) so while you can have empty lists, you can't have empty data types (?)
<drworm>
and also, while i'm add it, do we prefer guards or if's? 'match x with F (a, b) when a = y -> ...', or 'match x with F (a, b) -> if a = y ...'?
maihem_ has joined #ocaml
maihem has quit [Nick collision from services.]
maihem_ is now known as maihem
_JusSx_ has quit ["BitchX: the original point-and-click interface."]
Nutssh has quit ["Client exiting"]
Nutssh has joined #ocaml
maihem_ has joined #ocaml
maihem has quit [Nick collision from services.]
maihem_ is now known as maihem
maihem has quit [Read error: 60 (Operation timed out)]