foobarquux changed the topic of #ocaml to: www.ocaml.org
jemfinch_ is now known as jemfinch
gl has joined #ocaml
malc has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
* jemfinch
wants to learn more about phantom types.
gl has joined #ocaml
<malc>
jemfinch: what for?
<jemfinch>
I don't know...I'm curious if they can be used to implement static typechecking for a language implemented in O'Caml.
<jemfinch>
(static as in "when the language is compiled")
<malc>
phantom types are a hack around type system, and should be treated as such(killed and burried)
<jemfinch>
they come in useful.
<malc>
they are ugly
<malc>
hard to follow
<malc>
and so on
<jemfinch>
but they come in useful.
<jemfinch>
ML is ugly already :)
<malc>
i meant 'spirtually' ugly >B) cause the rest is in the eye of the beholder
<jemfinch>
it seems to me that the stuff they can do with phantom types is pretty cool.
<jemfinch>
and they don't cause runtime errors, so they're really not evil.
malc has quit ["no reason"]
smkl has quit [Read error: 60 (Operation timed out)]
smkl has joined #ocaml
mellum has quit ["zzz"]
Taaus_ is now known as Taaus
<jemfinch>
ooh, I don't recognize Taaus...he must be a new one :)
<Taaus>
Indeed I am :)
<jemfinch>
well, we're always happy to see new people here :)
<Taaus>
How'
<Taaus>
s the IRC bot coming along?
<jemfinch>
I've been busy at school for awhile and haven't had the oppurtunity to really work on the rewrite.
<Taaus>
Ah, okay :)
<jemfinch>
the old version still works well, but it has some latent bugs -- the rewrite works, but it lacks features.
<Taaus>
I've been pretty busy too... I study music at the university :)
<jemfinch>
you can always see the bot, btw, in #linux, #programming, and #networking on irc.arstechnica.com.
* jemfinch
studies Latin and Greek.
<Taaus>
Haha :)
<Taaus>
I guess we're just odd ;)
<jemfinch>
yup :)
<Taaus>
Although I've always had an interest in Latin... Not Greek, though :)
<jemfinch>
Latin is definitely my preferred language at the moment, but that's probably just because I'm better at it. Given more skill in Greek, I can see it becoming my preferred language to Latin.
<jemfinch>
Greek is definitely a lot harder, and a bit more esoteric, and a bit more expressive.
<Taaus>
Interesting.
<jemfinch>
and with the non-roman alphabet, it looks darn cool :)
<samx>
you've written a bot? is it here?
<Taaus>
Hehe :)
<jemfinch>
samx: I can bring it here if you'd like.
<jemfinch>
I've written two, actually, technically, since the second is an almost complete rewrite.
<samx>
i've been off from writing anything for a while, so started writing a programming language for the fun of it
<jemfinch>
I've done one of those, too :)
<jemfinch>
(for the bot, of course)
caml has joined #ocaml
<jemfinch>
that's the older version of the bot.
<jemfinch>
@botstats
<caml>
jemfinch: Connected 0 days, 0 hours, 0 minutes, and 12 seconds. I have used 0.046875 seconds of CPU time. I have allocated 1674672 bytes since I was started. I currently contain 1015808 bytes on my heap.
<samx>
something MLish?
<jemfinch>
no, something much more pythonish.
<samx>
ah
<Taaus>
jemfinch: Hehe, I was just about to say '@botstats' :)
<jemfinch>
it's mainly for configuration and stuff -- eventually you'll be able to write callbacks in it and such.
<jemfinch>
@unixstats
<caml>
jemfinch: Process ID 91489, running as user "jfincher" and as group "jfincher" from directory "/usr/home/jfincher/src/my/ocaml/foo" with command line "bin/ircbot caml irc.debian.org #ocaml".
<jemfinch>
@calc 100!
<caml>
jemfinch: 9.33262154439e+157
<jemfinch>
@leet "All your base are belong to O'Caml!!"
<jemfinch>
all kinds of useless stuff like that :)
<jemfinch>
this bot, unfortunately, has an infinite loop somewhere in the asynchronous networking library I translated into O'Caml from Python.
<Taaus>
I'd like to see the sources... Although I'm a total O'Caml newbie :)
<jemfinch>
so the new bot has a new, more minimalistic framework.
* jemfinch
doesn't really have good packages made up, and it relies on several other libraries he's written.
<samx>
mine is pretty much like scheme at the moment. looking to bring it a bit to the ml direction
<jemfinch>
@exit
caml has quit [Remote closed the connection]
<Taaus>
(BTW, I apologise if I seem a bit incoherent... I just returned from party, and I'm having trouble hitting the right keys ;)
<Taaus>
'from a party', rather.
<jemfinch>
Taaus: are you a native speaker of English?
<jemfinch>
samx: how many lines of code is yours?
<Taaus>
No, although I speak it fluently (when sober, that is ;) ... I'm a Dane.
<jemfinch>
ah, ok.
<samx>
jem, not many at all. i just started this week
<jemfinch>
what's the language of denmark? Danish?
<Taaus>
jemfinch: Yep :)
* jemfinch
is a bit curious about that now...
<jemfinch>
not very many non-native speakers would've made the correction you just made.
<jemfinch>
samx: is the code available? I'd love to see it.
<samx>
jem, nah, not at this point. i want to get more stuff running first
<jemfinch>
darn :)
<jemfinch>
I'll show you mine if you show me yours :)
<jemfinch>
Taaus: Danish follows almost the same grammar as English, doesn't it?
<samx>
heh. ask again in a few weeks (i hope), and maybe then i won't be too embarrased to show it anymore :-)
<jemfinch>
samx: if you only knew how poor my own code is...
<jemfinch>
samx: so what kinds of stuff have you done with it so far?
<Taaus>
jemfinch: The grammar is very simple (apart from nouns, which can be a pain for non-native speakers) ... The pronunciation is probably the most difficult part of the language.
<jemfinch>
is it very scheme-oriented, or different?
<samx>
nah, not the code quality, but the amount of it. it really does not do much yet.. most of the time i've been thinking about the design of it, what i'd like it to have, and how to get it to be very flexible
<jemfinch>
how are you doing it?
<jemfinch>
Taaus: it uses word order to indicate roles, right?
<samx>
at the moment what i have is pretty much like scheme (though, more limited). i'm aiming at somewhere, where you could have modules that do static type checking, and modules that are dynamically typed
<samx>
...and i could list an hour's worth of other things i'd like to have in it, but i rather get something done first, instead of be just talk :-)
<Taaus>
Word order to indicate roles? I'm not sure I understand.. (Like I said, I'm a bit slow right now ;)
<jemfinch>
Taaus: in English, "The boy gave the roses to the girl" is completely different than "The girl gave the roses to the boy" -- word order indicates who gets the roses.
<Taaus>
Oh, right... Danish is like that... As far as I can tell :)
<jemfinch>
on the other hand, in Latin, "Puer dat rosas puellae" and "Puellae dat rosas puer" (and, for that matter, the natural word order "Puer puellae rosas dat" or any other variation) all mean the same thing.
<jemfinch>
words in Latin (and Greek) are inflected to indicate their roles.
<Taaus>
Hehe, I was just about to mention Latin :)
<Taaus>
The worst part about Danish nouns is that the Danish equivalent of a/an (en/et) is totally arbitrary, and dependent on the noun...
<jemfinch>
samx: do you directly evaluate the conses resulting from parsing, or do you parse it into some intermediate abstract syntax tree type form?
<jemfinch>
Taaus: do Danish nouns have gender?
<Taaus>
There's no easy rule to determine whether to use 'en' or 'et' (although rules exist for compound nouns)
<Taaus>
Yeah, we have two genders. Umm... No-gender and Every-gender.. (That sounds a bit odd, but that's what they're called :)
<jemfinch>
is that what the difference between en/et is?
<samx>
jem, i'm directly evaluating them at least currently
<Taaus>
(When translated literally, that is :)
<jemfinch>
we'd usually say "neuter" for "no-gender"
<jemfinch>
I don't think we have a word for every-gender, though :)
<Taaus>
jemfinch: I know... Geez.. I said I was drunk, didn't I? ;)
<jemfinch>
samx: I started writing a small lisp interpreter, but wanted something a bit more language independent.
<samx>
jem, how is your language?
<Taaus>
BTW, do any of you know if there are any major differences between Haskell and O'Caml?
<jemfinch>
oh yeah, there are :)
<jemfinch>
Haskell is lazily evaluated. O'Caml is strictly evaluated.
<samx>
taaus, lazy/strict evaluation for example? :-)
<jemfinch>
Haskell is also much more monad-focused. It also provides support for overloading via type classes.
<Taaus>
Ah, I guess I ought to have said I knew about the lazy/strict evaluation ;)
<jemfinch>
syntactically it's a bit different.
<Taaus>
I guess I'll stick with O'Caml, then... :)
<samx>
jem, what does 'more language independent' mean ?
<jemfinch>
samx: I wanted something I could write several lexers/parsers for.
<samx>
have been planning something like that too, but haven't been able to come up with anything yet, that would be formal enough to actually work
<jemfinch>
for instance, the rewrite of the bot uses two different lexers/parsers, one for handling configuration files (which has access to the full language) and the other which handles actual irc messages.
<samx>
instead of lexer/parser, i've been looking more at lisp reader type stuff
<jemfinch>
what have you been learning about it?
<jemfinch>
Taaus: Haskell seems a bit more removed from the world at large than O'Caml, IMO.
<Taaus>
Ah.
<jemfinch>
samx: I'm curious about this lisp reader thing...
<samx>
well, i haven't really been looking at the lisp reader (i looked at it quite a while ago), but been trying to get designs down at something somewhat similar to it
<jemfinch>
I've definitely been more intrigued by lisp/scheme lately.
<jemfinch>
in all honesty, I'd *love* to see O'Caml with the macro/syntactical flexibility of lisp.
<samx>
yeah. me too. and also with bunch of other dynamic stuff
<jemfinch>
I wouldn't want it to be too dynamic.
<jemfinch>
one thing I like about O'Caml is that you can build only as much dynamicism as you want into it.
<samx>
i don't agree with that. i'm really missing eval, etc..
<jemfinch>
well, you can get eval as easily as an add-on library.
<jemfinch>
check out the asmdynlink library. It includes an eval.
<jemfinch>
I haven't missed it, though.
<jemfinch>
O'Caml has an ugly enough language that I really wouldn't want it for a configuration languge.
<samx>
you could have reprogrammed the syntax with camlp4 :-)
<jemfinch>
ick, no way.
<jemfinch>
that's too much work for too little result.
<samx>
well, as far as i can see, you are missing dynamic features then. it should not be too much work :-)
jao has quit [Read error: 113 (No route to host)]
<jemfinch>
no, I definitely think camlp4 is just a workaround around ocaml's...lacking syntax :)
<samx>
...if the syntax was easily programmable, and had eval, you would not have needed to write a language for the bot
<jemfinch>
no, but for the syntax to be easily programmable, it'd be s-expressions.
<jemfinch>
and that's not the most user-friendly syntax for non-programmers.
<samx>
why do you say that?
<jemfinch>
non-programmers don't like sexps.
<samx>
i mean, why would it need to be sexp to be easly programmable?
<jemfinch>
because how else are you going to easily manipulate the abstract syntax tree unless your syntax is a representation of it?
<samx>
have the parser convert it to sexp
<jemfinch>
I don't think anyone has really succeeded at having an easily manipulated syntax without being sexp based.
<jemfinch>
samx: have you looked into the asmdynlink library?
<samx>
dylan has one at least, though i don't know how easy it is. but i don't see why it could not be done
<samx>
nope
<jemfinch>
and I do definitely like that O'Caml *isn't* by default dynamic -- I like being able to reduce my runtime errors as much as possible.
<jemfinch>
the asmdynlink library gives you both loadable modules in native code programs and an eval.
<samx>
me too, but i've found that in many cases it would be very pleasant to have dynamic type system available in addition
<jemfinch>
write one :)
<jemfinch>
it's not very hard at all.
<samx>
one that would not require you to write constructors in front of everything. would require you to write a new syntax
<jemfinch>
samx: you sound almost like you'd prefer coding in lisp or scheme to ocaml.
<samx>
nope. i'd prefer to code in a mix of them :-)
<jemfinch>
what I'd like is something that's as safe as ocaml, but still gives me the dynamicism of lisp/scheme, where I can reload functions on the fly and whatnot.
<samx>
i think a programming language should not limit what you can do, but allow the tools so the programmer can choose what the language will limit the programmer from doing
<jemfinch>
I think there are tradeoffs and oftentimes no real way to balance the tradeoffs.
<jemfinch>
I don't think you can balance the safety of O'Caml with the dynamicism of scheme too much better than O'Caml does now.
<Taaus>
Woo... I'm going to bed... It's 8:15 am :/
<jemfinch>
Taaus: have fun sleeping :)
<Taaus>
jemfinch: I'll try ;)
<samx>
i don't think there would be any additional balancing needed for safety for getting bunch of dynamic features. have you checked gcaml ?
<jemfinch>
not really.
<jemfinch>
gcaml is just ocaml with overloading, isn't it?
<jemfinch>
NOTE: VSCM is no longer being actively developed. The author strongly believes that it would be better to
<jemfinch>
move from Scheme on to something better (e.g., Standard ML). (Development will not resume until I figure out
<jemfinch>
what features I would like to see in a Scheme-like language. At the moment, my ideas look an awful lot like
<jemfinch>
things that already exist: Haskell, ML, ...
<samx>
gcaml allows all kinds of neat stuff, including dynamic values
<jemfinch>
I liked that quote, btw, because you very rarely see people converting from Scheme to another language.
<samx>
yes, i remember reading that too, when i was looking around scheme stuff.. then there's also people who are doing static type checking in scheme that are saying the way to go would be dynamic with a non enforcing type checker
<jemfinch>
but then you're forced to make type declarations...
<jemfinch>
which, I suppose, is necessary in any language with overloading.
<samx>
nope, no type declarations. the type checker infers
<jemfinch>
but you won't have the efficiency gains of static typechecking either, though.
<samx>
were you not the one who was happy with python's execution speed ? :-)
<jemfinch>
I was :)
<jemfinch>
I'm just noting that disadvantage of adding static typing to a dynamic typing scheme instead of vice-versa.
jemfinch has quit [Remote closed the connection]
malc has joined #ocaml
malc has quit ["no reason"]
mellum has joined #ocaml
<mellum>
smt: aren't you in the same time zone as me? ;)