Demitar has quit [Read error: 110 (Connection timed out)]
mr_jim has quit ["Leaving"]
smkl has quit [zelazny.freenode.net irc.freenode.net]
smkl has joined #ocaml
ita has joined #ocaml
Nutssh has left #ocaml []
haroldo has joined #ocaml
<haroldo>
hi
<haroldo>
i've recently got very interested in lisp, trying not to get distracted by ocaml, but concious that I would be losing something valuable. Why is ocaml great?
<ita>
haroldo: because
<Smerdyakov>
Because the compiler can be much more helpful to you in making sure your programs do what you want.
<ita>
less ( and ) than in lisp esp :)
<Riastradh>
haroldo, it isn't! Use Scheme!
<ita>
nah scheme sux, even eiffel is better than that
<haroldo>
Riastradh, you helped me two days ago to understanc continuations
<Riastradh>
ita, Eiffel is totally different; that would be like saying Haskell is better than Mercury.
<haroldo>
ita, right, the compiler checks types up to the uttermost and guides you to fix things right?
<Smerdyakov>
haroldo, yes, with a reasonable definition of "uttermost." :)
<ita>
Riastradh: hey .. it was just a troll, like yours :)
<Riastradh>
ita, no, mine was a much better troll, because I'm talking about two related languages.
<ita>
Riastradh: a troll is a troll and yours was as hairy as mine
<haroldo>
Smerdyakov, ita, well in scheme i like continuations and small footprint, and in Common Lisp I like macros, a good standard, plenty of understandable textbooks and of course the clhs.
<Riastradh>
haroldo, all type checks are resolved at compile-time; this corrects a few bugs at compile-time, and eliminates the overhead of a few type checks, at the cost of _drastically_ reducing the set of valid programs.
<haroldo>
Riastradh, hmm
<Riastradh>
ita, never! My troll was better!
<Smerdyakov>
haroldo, Standard ML has a good standard.
<haroldo>
today I wrote to a former professor who used to program in scheme. Now she directed me to ml/caml/ocaml. I was surprised
<ita>
Riastradh: :)
<haroldo>
now ocaml seem to support things like PostgreSQL, and be supported by the .net
<haroldo>
for example, do you prefer cl macros or ocaml syntax expansion ?
<Riastradh>
The OCaml language itself does not involve a PGSQL library or support for .NET.
Nutssh has joined #ocaml
<Riastradh>
Gross and problematic as DEFMACRO is, it's a _lot_ nicer than camlp4.
<haroldo>
Riastradh, why defmacro is gross and problematic for you?
<haroldo>
other than strong compile type checks, what other benefits does ocaml have?
<Riastradh>
haroldo, DEFMACRO has significant problems with hygiene and phase separation. There's lots of material on this subject.
<haroldo>
Riastradh, what is phase separation?
<Riastradh>
Separating...phases, such as read-time, compile-time, macro-expand-time, and run-time.
<haroldo>
Riastradh, you mean that they are difficult to understand or that they are poorly stated/standarized?
<Riastradh>
haroldo, read Matthew Flatt's paper called 'You want it when?' about how macros and modules relate.
<haroldo>
Riastradh, and in scheme things differ much than in cl?
<Riastradh>
(You'll probably need to learn a bit more about macros before that will make sense to you, though.)
<haroldo>
Riastradh, i've come to the point that i beleive that gensym is all I nedd for my macros :)
<haroldo>
Riastradh, i've browsed through it quickly. It doesn't seem to talk much about COmmon Lisp
<Riastradh>
haroldo, no, but it talks about the macro system CL uses.
<haroldo>
Riastradh, ok. And why do you think that camlp4 is even worse?
<Riastradh>
It's just needlessly complicated due to the fact that OCaml has a really complicated syntax, instead of just S-expressions.
<haroldo>
queinnec paper "tower" seems appealing
<Nutssh>
Riastradh: Nice url.
<Riastradh>
Nutssh, are you complimenting me on a URL itself, or the HygieneVersusGensym page I wrote?
<Nutssh>
The paper. reading the url now.
<Riastradh>
...which paper?
<Riastradh>
You're confusing me!
<Nutssh>
Yoy wnt it when?
<Riastradh>
OK.
<Nutssh>
Does the same argument apply with common lisp?
<Nutssh>
Superficially, it appears not because each identifier binds to two slots, a function-value slot and a value slot?
<Riastradh>
That's a non-issue here. You could be using FLET or something.
<Nutssh>
Oh. Duh.
<Nutssh>
Its interesting -- I had not thought about accidental capture of function names. Small question -- what can hygenic macros not do that lisp macros can?
<Riastradh>
Of the explicit renaming variety? Nothing.
<Riastradh>
Of the SYNTAX-RULES variety, you can't evaluate Scheme code at macro-expand-time, and you're prohibited from introducing unhygienic identifiers at all.
<cleverdra>
nutssh - Paul Graham has asserted that hygenic macros can't perform pronoun-like tricks with bindings, but I haven't found that very interesting anyway.
<Riastradh>
And it's spelled 'hygienic,' by the way, not 'hygenic.'
<Nutssh>
Thanks.
<Riastradh>
Paul Graham is correct if you enforce having _only_ hygiene.
<Nutssh>
I have to learn more about them.
<Riastradh>
Explicit renaming or syntactic closures, mixed with pattern matching at the language level, compose the best macro system.
<pattern>
i actually like ocaml's syntax
<pattern>
i don't see it as "needlessly complicated"... it seems rather elegant to me
<Nutssh>
I have to learn some more about scheme. Can you suggest an implementation to use?
<Riastradh>
Nutssh, Scheme48 -- s48.org
<Nutssh>
OH! I thought that that implementation orphaned.
<Riastradh>
pattern, compared to S-expressions? Hah.
<Riastradh>
Nutssh, nope, it's under very active development right now, though they haven't yet released Scheme48 1.0, which they're working on.
<pattern>
Lost In Supurfluous Parenthesis ;)
<Nutssh>
Should I get a CVS?
<Riastradh>
pattern, S-expressions are simple and consistent.
<Riastradh>
Nutssh, there isn't a CVS repository for it; just get the source tarball.
<Nutssh>
0.57?
<Riastradh>
Yes.
<pattern>
well, i only know a little bit of scheme/lisp, so i'll refrain from commenting
<Riastradh>
pattern, S-expressions are a very simple lexical syntax; Scheme's grammatical syntax is defined in terms of S-expression objects, which greatly simplifies everything.
<pattern>
ocaml's syntax may be more complicated, but it's not necessarily "needlessly" so
<Riastradh>
Nutssh, also, this conversation would be much more on-topic in #scheme, by the way.
<Nutssh>
Yeah.
<Riastradh>
pattern, syntax causes cancer of the semicolon. You don't _need_ all that lexical syntax that OCaml has. Look at a sufficiently complicated camlp4 macro to see what trouble it causes.
haroldo has quit [Read error: 110 (Connection timed out)]
<pattern>
and what about cancer of the parenthesis?
<pattern>
and camlp4 isn't ocaml
<pattern>
it's an extension, that most people hardly use
<Riastradh>
Why do you think people rarely use it? Look at a sufficiently sophisticated use of it to see why.
<Nutssh>
Where do I find docs on it?
<Riastradh>
Nutssh, on Scheme48 or on camlp4?
<Nutssh>
camlp4.
<Riastradh>
pattern, and anyways, there's no such thing as an 'extension' in OCaml land; there's no standard and only one implementation.
<Nutssh>
I'm reading the changes in scheme48 since .53.
<Smerdyakov>
Hm. Any particular reason to post a link to a 12-year-old paper now? :)
<pattern>
not everyone keeps up with the state of the art
<pattern>
as is evidenced by the number of thousand year old static vs dynamic typing flamewars seen here ;)
<Smerdyakov>
What does your last statement have to do with your second last statement?
<pattern>
the last statement is an example supporting the previous one
<Smerdyakov>
So you are asserting without proof that that particular "thousand year old argument" is not worth having?
<pattern>
no
<pattern>
just that some points are reiterated now, which have been brought up time and time again despite being settled long ago
<pattern>
showing that not everyone keeps up with the state of the art
<pattern>
so might be interested in articles such as this one
<Smerdyakov>
How has "static typing vs. dynamic typing" been settled?
<pattern>
some points on the issue have, yes
<mellum>
Smerdyakov: we are right, the other party consists of morons.
<Smerdyakov>
pattern, like what?
<pattern>
for example, it used to be a valid point that static typing required a lot of extra type annotations
<pattern>
with type inference this is no longer a credible point to bring up against those languages which have the feature
<pattern>
yet people still bring that up
<pattern>
over and over
<pattern>
because they're clearly ignorant
<Smerdyakov>
Ah. But not people in any functional language channels. :)
<pattern>
of course, to a person like yourself this might be old hat
<pattern>
if only that were true :)
malc has quit ["no reason"]
<pattern>
anyway, i thought _some_ people might be interested in the article
<pattern>
i don't require it of everyone
<pattern>
:)
<Smerdyakov>
You mean there are people in Lisp channels who persist in attacking static typing for increased code size?
<pattern>
in this channel too
<Smerdyakov>
O_o
<pattern>
some lisp partisans
<pattern>
some python
<mellum>
increased code size? I haven't heard that argument ever :)
<Smerdyakov>
Type annotations => increased code size
<pattern>
i've heard of it in regards to embedded apps
<Smerdyakov>
I mean the source code, not compiled code.
<pattern>
but on this channel it's mostly re: static vs dynamic, or syntax
<teratorn>
that's a pretty dumb attack
<teratorn>
considering that it's common practive to annotate "types" in non-staticly typed languages
<pattern>
perl -> $foo="bar";$blah="baz";
<pattern>
no annotation
<teratorn>
amazing
<pattern>
ain't it?
<pattern>
i bet a statically typed language can't do that
<teratorn>
what I meant by that is sensible pepole at least use documentation to annotate how their functions/methods work and what objects they accept/return.
<pattern>
ah
<pattern>
of course
<pattern>
but documentation and code can get out of sync
<pattern>
a "type annotation" bug that won't be caught by the compiler
<teratorn>
yes
<pattern>
and documentationi is usually the exception rather than the rule
<teratorn>
yes
<teratorn>
it is common for me to be reading code and guessing what types of objects should be used
<teratorn>
usually, it is obvious from their names, but still I don't like guessing and sometimes it takes a fair amount of time to figure it out
<pattern>
a weakly typed language would make that job even harder
<Demitar>
You mean everyone doesn't read the source to find out how things are supposed to work? I've heard rumours of people actually asking for documentation, now that can't be true can it?
<pattern>
they can ask all they want ;)
<teratorn>
I think it would be pretty cool to have "static object interface checking"
<teratorn>
in non-static languages, that is.
<Demitar>
That would have kept me in python a bit longer before renewing my attempts on ocaml, so I guess I'm pretty happy there weren't any. :)
<pattern>
i'd like to learn python
<pattern>
lots of people seem to like it
<teratorn>
it's not hard
<pattern>
some more than ocaml, though i find that hard to believe ;)
<pattern>
yep, it seemed pretty similar to perl last time i looked at it
<Demitar>
My only itch with it was that all my data forwarding got out of hand in my 10k loc app. In OCaml I can get away with writing bad code. ;-)
<pattern>
"data forwarding"?
<Demitar>
Well I forwarded data through various interfaces and thus I had to ensure i actually dealt with the correct type in the correct places, static typechecking would really have helped.
<pattern>
i see
<teratorn>
huh
<teratorn>
that doesn't make any sense at all.
<pattern>
i had to do a lot of that in c
<pattern>
asserts and whatnot
<teratorn>
Demitar: not to say that checking type(obj) at times isn't useful (for different reasons), but if you're doing a "lot" of it then you're probably doing something wrong.
<Demitar>
Then again it grew into a beast which included an irc bot, reloading of internal commands from the source, and a webserver serving logs on demand. Not to mention having multiple interfaces (ncurses and SDL being the most reliable ones). :)
<teratorn>
and you didn't use Twisted?
<Demitar>
teratorn, well the interface code was a bit of lasagna code really.
<Demitar>
teratorn, well twisted wouldn't have helped all that much, the irc bot and the webserver were only optionally stuff I added for fun. ;-)
<pattern>
it's main function was an editor
<pattern>
and a spreadsheet
<teratorn>
heh
<pattern>
with a flight simulator
<Demitar>
No, a WorldForge client actually. ;-)
<teratorn>
oh it /was/ a network client then!
<Demitar>
The command interface was lovely IMO, but not everyone considers regular expressions the way to define command syntax. ;-)
<Demitar>
teratorn, indeed.
<teratorn>
Demitar: threaded? asyncore?
<Demitar>
No threads (beyond some working around io, mostly connect() and dns queries).
Hadaka has quit [Read error: 60 (Operation timed out)]
<Demitar>
And no, it was using our protocol Atlas, and I'm not sure asyncore was avaiable back when I started it anyway.
<Demitar>
The thing I value the most with OCaml is the maintenance benefits of the strong static typing.
<stepcut>
how would I do something like: gcc -DHELLO_STRING="hello, world!\n" hello.c in ocaml ? (where changing HELLO_WORLD affects what hello world string is printed?)
<stepcut>
It seems like I can do it with camlp4, but I am missing something...
<stepcut>
let _ = print_endline HELLO
<stepcut>
ocamlc -pp "camlp4o pa_macro.cmo -DHELLO=hi " test.ml -o test
<stepcut>
File "test.ml", line 1, characters 22-27:
<stepcut>
Unbound constructor HELLO
Hadaka has joined #ocaml
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
<Nutssh>
You don't AFAIK?
<Nutssh>
Make a seperate module 'Configuration' and put all the definitions there?
<stepcut>
hrm
<Nutssh>
Why do you want to do that?
<stepcut>
I want the file to contain the build time
<stepcut>
I could use sed and stuff, but it would be nice to not have to actually generate a .ml file during the build process
<pattern>
use m4 ;)
<stepcut>
hrm
<pattern>
that was a joke
<pattern>
i'm sure it must be possible in camlp4... but i don't know camlp4, so i thought i'd offer a thoroughly unhelpful suggestion :)
<stepcut>
I am not sure, and I looked at the source code
<pattern>
the "unbound constructor" makes me think that it doesn't like the fact that HELLO starts with an upper case letter
<pattern>
but the preprocessor should take care of that
<pattern>
so it's weird
<stepcut>
i think -DHELLO works, but -DHELLO=value does not
<stepcut>
however inside a .ml you can do: DEFINE HELLO = "hello, world!"
<stepcut>
but that does not help me
<pattern>
-DHELLO just allows you to test to see if HELLO is defined?
<stepcut>
"<string> Define for IFDEF instruction."
<pattern>
yep
<stepcut>
that is from pa_macro.ml
<pattern>
not macro substitution
<pattern>
or macro expansion
<pattern>
however you wanna put it
<stepcut>
yeah, -DHELLO, lets you use IFDEF
<pattern>
well, m4 will do macro expansion for you
<pattern>
it won't be camlp4, but it'll work
<stepcut>
I will probably just do: echo "let version = $VERSION" >> .version.ml
<pattern>
also, you might have to do some tricks with your make file so that HELLO is passed to m4 when you do make -DHELLO... i haven't used m4 in ages, so i don't remember anything about it
<stepcut>
I could rewrite the app in template haskell
<stepcut>
:p
<pattern>
well, m4 is easy
<stepcut>
i think m4 is probably overkill for what I need
<pattern>
and it'll just make the substitution in your source, which will still be ocaml after it's processed
<pattern>
yeah
<pattern>
i'm sure someone here knows camlp4 and can answer your question
<pattern>
if there is an answer
<pattern>
also you could ask on the list or email camlp4's author
ita has quit [Remote closed the connection]
stepcut has quit ["ERC Version 4.0 $Revision: 1.577 $ (IRC client for Emacs)"]
<Demitar>
Although he's gone now I think what he might be missing is quotes (") around the string hi.
<Demitar>
Not that I really know. ;-)
<Demitar>
NIght all.
Vincenz has quit []
Kinners has joined #ocaml
gim_ has quit ["pouf"]
mimosa has quit ["J'ai fini"]
_JusSx_ has quit ["BitchX: the un-Cola"]
wazze has quit ["Learning about how the end letters on French words are just becoming more and more silent, I conclude that one day the French]
housetier has quit ["#breaks @ irc.highteq.de"]
__DL__ has quit [Read error: 104 (Connection reset by peer)]
cjohnson has quit ["Drawn beyond the lines of reason"]
cjohnson has joined #ocaml
cjohnson has quit [Client Quit]
cjohnson has joined #ocaml
cjohnson has quit ["Drawn beyond the lines of reason"]