exa has quit [Read error: 110 (Connection timed out)]
Raziel has joined #ocaml
vincenz has quit [Connection timed out]
_fab has quit [Remote closed the connection]
vincenz has joined #ocaml
kmag has joined #ocaml
<kmag>
KrispyKringle: in regard to our conversation the other day, pypy outputs C, LLVM bytecode, javascript, python source, or pyrex source
ax has left #ocaml []
<KrispyKringle>
kmag: No shit. Interesting. Wish they had more on the webpage for lazy people like me. ;)
<KrispyKringle>
Javascript?!
<kmag>
that's what they said
<KrispyKringle>
Weird.
<KrispyKringle>
Jesus.
<KrispyKringle>
Why? :P
<kmag>
my guess is AJAX
<KrispyKringle>
so you can write stuff in python and have it run on a browser?
<KrispyKringle>
odd.
<kmag>
there are some AJAX libraries for a few languages
<KrispyKringle>
interesting.
<kmag>
a friend was showing me AJAX for Ruby on Rails the other day
<kmag>
it's pretty cool
<KrispyKringle>
Wait, so you write the backend in ruby and the frontend in Javascript? Or in Ruby that's translated into JavaScript?
<kmag>
There's some server-side Ruby that gets translated into JavaScript
<kmag>
and sent to the browser
<KrispyKringle>
oh
<KrispyKringle>
creepy buzzwords.
<kmag>
Ruby certainly is an odd critter
<KrispyKringle>
Ruby's OK. I much prefer Python.
<kmag>
I'm still giving Ruby a chance
<kmag>
I've known Python for a long time, and am just learning Ruby now
<KrispyKringle>
I didn't give it much of a chance, I admit.
<KrispyKringle>
I wrote a small program in it.
<KrispyKringle>
It's nice enough, but I'm not a big OO freak.
<kmag>
it would be nice if Python had something like Ruby's method_missing method
<KrispyKringle>
What's that?
<KrispyKringle>
It runs if someone calls a missing method? :P
<kmag>
method_missing gets called if you call a method that's not defined for that particular object
<KrispyKringle>
Oh. Eh, you could write a wrapper that did that, but I guess that's not really what you want.
<KrispyKringle>
Well, two ways:
<KrispyKringle>
You could write a wrapper you use to call callables that runs some .__missing_method__() function instead if the called function doesn't exist.
<KrispyKringle>
Or, you could construct a single object that would run a method for *any* method called if it doesn't have a name.
<KrispyKringle>
The latter would be close to what you want.
<KrispyKringle>
using .__getattr
<KrispyKringle>
Er, .__getattr__
<KrispyKringle>
Actually, I think that does *exactly* what you want.
<kmag>
yes, I've seen some interesting presentations
<kmag>
overriding __new__ and __getattr__, you can do some crazy stuff in Python
<KrispyKringle>
Yeah.
<KrispyKringle>
One of the things I really like about Python is how transparent it all is.
<kmag>
but the nice thing about missing_method is that in the common case, you skip the crazy stuff
<KrispyKringle>
Everything is implemented *in python*.
<KrispyKringle>
Ther's no magic.
<KrispyKringle>
Sure.
<KrispyKringle>
It does make things a bit more cluttered sometimes.
<kmag>
__call__.__call__.__call__()
<KrispyKringle>
But I just used a really nice wrapper for the Flickr API that's incredibly short because it doesn't have to impelemnt each API call.
<KrispyKringle>
Instead, it uses __getattr__, and you just do object.flickr_api_callMethod() and it automatically calls the flickr.api.callMethod() you gave it in the Flickr REST API.
<KrispyKringle>
Very short, very sweet.
<KrispyKringle>
Although it means you can't use dir() to see what's in the API. I wonder if it'd be possible to populate that somehow (you can get all the available methods from flickr using reflection, I think).
<kmag>
I've seen something silimar for AIM's TOC protocol in Python
<kmag>
sort-of...
<kmag>
it didn't know all of the commands a priori
<kmag>
but when a message came in, it looked for a specially named method
<KrispyKringle>
Right. Same idea here but in reverse.
<KrispyKringle>
Since these are always one-way calls.
<kmag>
pypy doesn't implement your standard compiler
<kmag>
instead it traces execution of real Python code
<kmag>
and compiles the flow graphs to the target language
<KrispyKringle>
That's pretty neat.
<kmag>
yea, but I don't know how they get untouched methods to compile
<kmag>
or branches that are never taken
<KrispyKringle>
Well, you can't decide what gets called in a static flow analysis. They must just take both paths all the time.
<kmag>
from their description, it wasn't static flow analysis, though
<kmag>
on #pypy it sounded like they'd run some python for a time, and then decide to dump the flow graphs they'd traced out to the target language
<kmag>
the cheif advantage being that they could use python to dynamically generate python and execute it
<kmag>
kind of like a preprocessor
<KrispyKringle>
But like you said, they can't just arbitrarily run it. They have to make it take every possible path.
<kmag>
sounds like it would be easy to have a very buggy build
<kmag>
Changes in code change the coverage of unit tests all the time
<kmag>
but they need 100% coverage
<KrispyKringle>
Yeah, that doesn't make a whole lotta sense to me.
pango__ has joined #ocaml
pango_ has quit [Read error: 110 (Connection timed out)]
shirogane has joined #ocaml
batdog|gone has joined #ocaml
batdog|gone is now known as batdog
vezenchio has quit ["\\o hutari ga kitto deaeru you na mahou wo kakete - ryoute wo sotto kasanete hora! hohoemu kara - hontou no kimoti kidukanai ]
Skal has joined #ocaml
bd_ has quit [Read error: 110 (Connection timed out)]
ramkrsna has joined #ocaml
journey has left #ocaml []
ecc has quit [Read error: 110 (Connection timed out)]
shirogane has quit [Remote closed the connection]
ecc has joined #ocaml
Nutssh has joined #ocaml
ramkrsna has quit [Connection timed out]
vodka-goo has joined #ocaml
batdog is now known as batdog|gone
ski has quit [Read error: 110 (Connection timed out)]
pango__ has quit [Remote closed the connection]
pango has joined #ocaml
cmeme has quit ["Client terminated by server"]
ppsmimou has joined #ocaml
Skal has quit [Read error: 110 (Connection timed out)]
Skal has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Revision17 has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
m3ga has joined #ocaml
Nutssh has quit ["Client exiting"]
bd_ has joined #ocaml
Raziel has quit ["Yo soy goma. Tú eres cola."]
faigo has quit [Remote closed the connection]
Schmurtz has quit [Read error: 110 (Connection timed out)]
vezenchio has joined #ocaml
__DL__ has joined #ocaml
Schmurtz has joined #ocaml
<flux__>
nice, partially evaluating printf now works now as one would expect (3.09)
<dylan>
Oooh. Nice.
<dylan>
instead of just working the first invocation?
<flux__>
yes
<dylan>
hmm, omlet.vim isn't highlighting the functor keyword.
<vodka-goo>
not my fault, I didn't make the syntax highlighting, only the indentation
<dylan>
it doesn't indent it right either. ;)
<vodka-goo>
that's my fault :D
<vodka-goo>
I know I've lots of bugs to fix, but I'm very busy :(
<vodka-goo>
mail-bomb me if you really need something (except speed)
<dylan>
Haha. It's okay. It works fast enough
<dylan>
hmm, odd: "syntax/omlet.vim:133:syn region ocamlMPRestr2 start="\sfunctor"
<dylan>
it is mentioned in the syntax highlighting file, but somehow not used. O.o
<dylan>
I was just after talking to myself, asking "When would I ever use a higher-order functor?", when all the sudden I need one in a program I'm writing. :P
<dylan>
Not that I talk to myself. often...
<vodka-goo>
:p
<Smerdyakov>
I wonder if there are any really successful scientists/mathematicians/engineers who don't talk to themselves.
<dylan>
Hah, that is like asking if there are any sane ones. :)
<Smerdyakov>
That depends on if you are talking about insanity as a disease or as a different and valid way of thinking.
<dylan>
*nods*
<Smerdyakov>
I won't agree that all of the people in the class I named are sick.
<dylan>
Not sick, certainly.
<dylan>
Anyone that succeeds in something is essentially abnormal, and sadly abnormalities are often treated as sickness.
rq has quit ["Leaving"]
ski has joined #ocaml
exa has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
vodka-goo has quit [brown.freenode.net irc.freenode.net]
juri has quit [brown.freenode.net irc.freenode.net]
vodka-goo has joined #ocaml
Oatmeat|umn has quit ["Leaving"]
Oatmeat|umn has joined #ocaml
juri has joined #ocaml
gg has joined #ocaml
<gg>
hi :)
<gg>
does anyone speak french?
<vodka-goo>
ouais
<vodka-goo>
plein
<gg>
:)
<gg>
c'est quoi la difference entre un let machin=truc in
<gg>
et un let machin = ref truc
<vodka-goo>
gg: tu peux plus changer machin si ya pas le ref
<gg>
(entre une declaration et une reference koa)
<gg>
donc
<vodka-goo>
pense au premier comme à une définition, inchangeable
<gg>
un let tt seul equivaut a une constante?
<gg>
et le second a une variable?
<gg>
(en c++ et autre)
<vodka-goo>
gg: pas tt a fait, si tu définis une structure qui contient des champs mutables
<gg>
he?
<mauke>
haha, I think I understand what you're saying
<vodka-goo>
par exemple let s = "bla" in s.[0] <- 'B' ; s
<vodka-goo>
gg: dans le noyau "fonctionnel pur" ton idée est bonne
<vodka-goo>
ms certains objets peuvent etre modifiés
<gg>
escuse je suis debutant en ocaml :/
<vodka-goo>
s pointe toujours vers la meme chaine (sinon faut un ref)
<gg>
jcomprend pas tout lol
<vodka-goo>
mais la chaine derriere s peut etre modifiée (pas pur)
<vodka-goo>
gg: pas de pb
<gg>
en tt cas merci pour ton aide :p
<gg>
c'est quoi alors la difference constante c++/let ocaml?
<vodka-goo>
je suis pas calé en C++..
<vodka-goo>
ms pe bien que c pareil apres tout :)
<gg>
c++ ou autres
<gg>
une constante en c++
<vodka-goo>
disons que par rapport au C, le let est pas équivalent au #define
<gg>
c'est une variable kon peut pas changer
<vodka-goo>
par contre le mot clé const est pe bien le meme genre de truc..
<gg>
#define c une directive pour le preprocesseur
<vodka-goo>
anybody knows how similar/different are the C++ 'const' keyword and the caml let..in definition ?
<mauke>
'let' is pretty much like C++'s const or C's enum
<mauke>
the latter is restricted to integers, though
<vodka-goo>
which stinks, btw
<vodka-goo>
gg: bon t'as du comprendre, il confirme :)
<gg>
mauke << thx :)
<gg>
vodka-goo << merci :)
<mauke>
bitteschoen :-)
<mauke>
hmm, C's definitions are more like 'let rec', actually
<mauke>
let rec makes the identifier visible in its own definition
<mauke>
e.g. let rec ones = 1 :: ones (* infinite list *)
<Schmurtz>
interesting the infinite list...
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
<KrispyKringle>
So anyone here have tips on database access? I really don't care what database I use (as long as it's free), but rather how good the interface is. I need relatively high performance persistent storage, essentially, and the moduels I've tried either don't compile on OSX or have crappy interfaces.
<Schmurtz>
which modules did you try ?
<Schmurtz>
modules like mysql access should compile without many problems
cmeme has joined #ocaml
cmeme has quit [Remote closed the connection]
<KrispyKringle>
Schmurtz: I couldn't get the ocaml-mysql one to compile, actually.
<KrispyKringle>
Well, I couldn't get it to link. Then I managed to get it to link, but it can't find the C routines at runtime or something. I'm not real familiar with C module usee in OCaml.
cmeme has joined #ocaml
<Schmurtz>
I'll try to compile it…
<KrispyKringle>
Schmurtz: Yeah, let me know if you get it working. :)
<KrispyKringle>
I had to replace the OCamlMakefile with the more recent version.
<KrispyKringle>
And that got it to compile, but not work.
<KrispyKringle>
I'm swtill debating using Python for this project, though. 'Cause I'm behind, and I code Python a bit faster than I code OCaml ;)
<KrispyKringle>
But I'm glad to hae that wpart working, at least.
<Schmurtz>
I've never used python, so I won't help you to make a choice
<KrispyKringle>
heh
<Schmurtz>
I can only say that ocaml is bytecode-compiled and may natively-compiled
<Schmurtz>
+be
<KrispyKringle>
Python's a great language. But I fear that if I use it, I may have to optimize a few fmodules later in C.
<KrispyKringle>
And I fear about dynamic typing, since I somethimes result in more unsafe programs (runtime errors rather than compile time).
<KrispyKringle>
Yeah, that's one of the draws to OCaml, for me.
<Schmurtz>
if performance is important, ocaml may be a good choice
<KrispyKringle>
Performance is only going to be an isue in one place, I think.
<Schmurtz>
ok
<KrispyKringle>
For which I can use C, but I'd rather not.
<KrispyKringle>
Decisions, decisions. ;)-
<KrispyKringle>
Anyweay, I have to get going. thanks so much for the help.
<KrispyKringle>
I owe you. ;)
<Schmurtz>
there's too many languages
* dylan
is using m4 to write C code to link in with ocaml...
<Schmurtz>
thinks about a single syntax to do C-like programs, interpreted ones...
batdog|gone is now known as batdog
<gg>
++
gg has quit ["Leaving"]
pango has quit ["Leaving"]
pango has joined #ocaml
Raziel has joined #ocaml
<kmagdsick>
Schmurtz: there are some interpreted C variants
<kmagdsick>
Schmurtz: I think one is called "Interactive C"
<bluestorm>
hehe
<kmagdsick>
Schmurtz: MIT's 6.270 robot competition used to use interpreted C, but now the boards are fast enough to handle Java
<Schmurtz>
ok
<bluestorm>
ESR a dit : (In this wise shalt thou travel the Way of the Camel.)
<Schmurtz>
the problem is that it's not widely used
<Schmurtz>
and maybe many compatibility problems
<Schmurtz>
in fact, my though was purely idealitic ;)
<bluestorm>
do you know
<bluestorm>
about the 'revised syntax' ?
<KrispyKringle>
Schmurtz: You should still learn Python ;)
<Schmurtz>
I don't need it actually
<Schmurtz>
so I'll wait
<Schmurtz>
bluestorm, what is it ?
<Schmurtz>
KrispyKringle, I know what are main python features, if in a futur projet I found python is a good choice, I'll learn it
<KrispyKringle>
Schmurtz: Yeah. My main complaint is that dynamic typing seems to result in more errors. Or maybe that's just me being stupid.
* Schmurtz
thinks he has some problems with english tenses...
<KrispyKringle>
But I feel it to be less safe than OCaml.
<KrispyKringle>
And OCaml is undoubtedly faster, when done with opt.
<bluestorm>
Schmurtz:
<bluestorm>
another ocaml syntax
<Schmurtz>
ok
<bluestorm>
introduced in Camlp4 manual
<bluestorm>
hum
<bluestorm>
have to go and eat
* bluestorm
is away: eating
<Schmurtz>
KrispyKringle, it's compiled to native code, so the overhead compared to C is only due to ocaml architecture (garbage collector, many checks, no efficient floating operations...)
<vodka-goo>
KrispyKringle: you're not stupid, I strongly believe that dynamic typing leads to more error too ;)
<KrispyKringle>
vodka-goo: What I'm unclear on is what dynamic typing buys you versus polymorphism and typeclasses. In other words, I can't figure out what you can do with the former that you couldn't do with the latter.
<KrispyKringle>
So what I want is a language that hast he latter instead of the former.
<vodka-goo>
it's a nightmare to use python/perl/ruby after ocaml. although the syntax is nice, it's always terribly annoying to get runtime errors for typos or forbidden arguments (especially when you're learning a new API).
<KrispyKringle>
Or instead of typelcasses, "everything is an object" types (like in Python) with casting methods (e.g. foo.__str__() in Python).
<Schmurtz>
dynamic typing check *everything* at compile time
<KrispyKringle>
Does that make sense?
<vodka-goo>
KrispyKringle: perfectly
<KrispyKringle>
Schmurtz: No, but I mean in terms of flexibility.
<Schmurtz>
no, it's the contrary...
<vodka-goo>
there are things you won't get with static checks, but I believe/hope it's not so much
<KrispyKringle>
I feel that polymorphism gives you most of the way, and typeclasses or casting methods allows you to dynamically cast things as you need.
<KrispyKringle>
But only in ways that make sense.
<Schmurtz>
and dynamic typing check what append on execution
<KrispyKringle>
Right.
<KrispyKringle>
But for example:
<KrispyKringle>
in Python, "map" calls are essentially untyped.
<KrispyKringle>
so you can do map ('a -> 'b) -> 'a
<KrispyKringle>
When you should only be able to do it on 'a lists.
<Schmurtz>
if you don't try every situation, you may have resulting type errors
<KrispyKringle>
With polymorphism, we get the same flexibility with proper safety. And with typeclasses, we get the ability to convert things to types that make sense at runtime.
<KrispyKringle>
Essentially.
<vodka-goo>
one difficult thing to get with static checks is overloading and implicit casts also
<KrispyKringle>
vodka-goo: That's why I'm advocating the use of typeclasses to do that.
<KrispyKringle>
E.g. the "show" typeclass in Haskell.
<Schmurtz>
vodka-goo, caml don't have implicit cast
<Schmurtz>
ada too
<vodka-goo>
I know
<KrispyKringle>
"show" is equivalent to Python's .__str__() method (which returns a string representation o fthat object).
<Schmurtz>
vodka-goo, I hope you know ;)
<vodka-goo>
I'm just wondering how useful it is
<KrispyKringle>
So if you have something like that, you can do implicit casting at runtime, but it's still typesafe (since you only implement .__str__() or "show" for things where it makes sense)/.
<Schmurtz>
it's a mean to disallow starting to use implicit cast
<vodka-goo>
KrispyKringle: are you talking about structural subtyping for objects ?
<Schmurtz>
if you start, and go further, you get C++ implicit type cast
<KrispyKringle>
vodka-goo: I think so, but I'm not entirely sure I kno wwhat that means ;)
<Schmurtz>
which is awful
<KrispyKringle>
hmm.
<vodka-goo>
KrispyKringle: ok, we just have different vocabularies/backgrounds ;)
<KrispyKringle>
Yeah.
<Schmurtz>
in some C++ program you have absolutely no idea of what assumption do the compiler
<vodka-goo>
you're probably right
<Schmurtz>
it's very hard to understand => bugs
<KrispyKringle>
Oh...
<vodka-goo>
overloading is nice sometimes
<KrispyKringle>
So that's an issue.
<Schmurtz>
but if you don't use it to much
* vodka-goo
searches for an example ... I actually never use overloading cause always use OCaml :)
<KrispyKringle>
In my scheme, you may be able to find multiple typings that would work.
<KrispyKringle>
How do you know which one to use (or whih one the compiler is using)?
<KrispyKringle>
With implicit casting.
<flux__>
it would be nice if a printf-like construct could be written in ocaml..
<Schmurtz>
for instance it's bad to create automatic conversion between to realy different types
<vodka-goo>
KrispyKringle: there is a most general type (that's what ocaml does) (if you're still talking about struct subtyping)
<KrispyKringle>
Rightl.
<Schmurtz>
*two
<KrispyKringle>
flux__: Check out Printf.
<KrispyKringle>
The module.
<flux__>
(maybe even without using strings; the one I saw for sml seemed alright)
<KrispyKringle>
vodka-goo: Right.
<flux__>
krispykringle, I think it still comes down to that the compiler makes magic, no?
<flux__>
with format4 types and all
<KrispyKringle>
flux__: Printf? I don't know how OCaml does it.
<KrispyKringle>
I'm not an OCaml guru. ;)
<Schmurtz>
in ocaml printf, the first argument must be a constant
<Schmurtz>
this constant defines what are the following arguments
<Schmurtz>
(it's not a precise description)
<vodka-goo>
another nice thing to have (but even more ugly for typing) is ruby-style mixins
<KrispyKringle>
I never got into mixins.
<KrispyKringle>
Just not overly appealing to me.
<KrispyKringle>
*shrug*
<vodka-goo>
there was a proposal for mixins in ocaml but I don't know how it is, how it's linked..
<Schmurtz>
what are mixins ?
<vodka-goo>
ruby mixins more look like some kind of meta programming
<vodka-goo>
Schmurtz: don't know exactly.. something between objects and modules
<Schmurtz>
a kind of preprocessor run at runtime ?
<vodka-goo>
I only know in ruby, where it is something quite ugly with a silly soft semantics
<dylan>
AFAIK: Mixins are inheritence of methods but not data.
<dylan>
Sort of like "include" in an ocaml module.
<vodka-goo>
yes
<Schmurtz>
ok
<dylan>
Mixins can also be though as creating an anonymous intermediate class and inheriting from that.
<vodka-goo>
it also allow ruby guys (with some more ugly magic) to automatically create getter and setter methods for some attribute
<dylan>
No, that's different.
<dylan>
afaik.
<vodka-goo>
it's mostly about the additionnal ugly magic, you're right. the point is that it looks nice to have.
<dylan>
it's simply because everything in ruby is runtime, you can define new methods on an object any time you want.
<dylan>
ugly seems quite a matter of perspective. I kind of find it elegant. :)
<flux__>
hmm.. (after reading about mixins) how do mixins differ from c++ and (multiple) inheritance?
<dylan>
flux__: No data inheritence.
<flux__>
dylan, what happens to the attributes then? this is different from simply not having attributes in the parent class?
<dylan>
ruby does not have attributes. ;)
<dylan>
but for object data (@foo), it stays in the object that includes in the mixin.
<dylan>
"ixins can be thought of at a simplistic level as importing the methods of another class into your subclass."
<dylan>
"It creates an empty anonymous class, imports everything into that class, and then chains the new class into your SI ISA path. In other words, if you say:
<dylan>
er, ".
<dylan>
where it = ruby.
* dylan
talks too much.
<vodka-goo>
dylan: elegant but uncontrollable
Raziel has quit ["Yo soy goma. Tú eres cola."]
<dylan>
vodka-goo: I am anarchistic programmer. :)
<vodka-goo>
one has too chose..
<vodka-goo>
I like perl, too :)
<vodka-goo>
but sometimes, not
<vodka-goo>
there are some times for poetry, and some times for safer things
<dylan>
The odd thing is, I never experience problems from runtime types. It'd expect otherwise.
<vodka-goo>
dylan: do you think "dynamic" languages are popular because of dynamic typing or because of the ease of use ?
<dylan>
Yes.
<vodka-goo>
frankly, those mixin, introspection stuff are not so important
<Schmurtz>
perl is like C : you may create good programs, with few bugs
<dylan>
Not, not quite.
<Schmurtz>
but if you use every features of the language, your code is unreadable
<vodka-goo>
dylan: give me an intuitionnistic proof ;)
<dylan>
When there are bugs, they don't shoot me in the foot.
<Schmurtz>
that was the though of the day
<vodka-goo>
(I'm afraid that was a bit obscure... I was just telling that Yes was a not a very informative answer to my question)
<dylan>
vodka-goo: I was saying yes to bother things you proposed. :)
<dylan>
er
<dylan>
to both.
<vodka-goo>
mmm
* vodka-goo
like static typing these days, wants to put static typing into those sexy scripting languages
<dylan>
My favorite idion in OO languages is thing.send("action_" + action, *args).
<dylan>
I... don't know that this could be done in a statically typed language.
<Schmurtz>
in C++, call to object members are statically typed ?
<Schmurtz>
the only thing which create bugs is cast to subclass without check
* dylan
likes both static and dynamic typing. But then he doesn't usually not like things. :)
<dylan>
I'd like to have both in the same language, though.
<Schmurtz>
;)
<dylan>
and dynaml seems a little hairy to use for now.
<vodka-goo>
Schmurtz: the bad point with C++ is that it has no inference
<Schmurtz>
yes, but it has templates
<dylan>
or memory management...
<Schmurtz>
for memory management I totaly agree ;)
<vodka-goo>
did anybody try smalltalk ?
<dylan>
I think smalltalk is nice, except for the syntax.
<vodka-goo>
maybe I should take a look to the way it handles objects
<dylan>
pretty much like ruby, right?
<dylan>
Or $insert_dynamic_oo_language
<Schmurtz>
I like the parameter naming of smalltalk
<dylan>
That part I like.
<Schmurtz>
you dont have a dosomething(a,b,c,d,e)
<dylan>
things like ^ for return and | | for declaring vars makes me confused.
<Schmurtz>
but a dosomethingwithA:a andB:b ...
<dylan>
That's something I like about Objective C too.
<Schmurtz>
it's easier to understood the program
<Schmurtz>
ok, in fact I only know objective-c
<Schmurtz>
;)
<Schmurtz>
never see smalltallk code
<dylan>
I wonder if you could have a static type system, with dynamic objects?
<dylan>
The main thing I miss in ocaml's OO is being able to invoke arbitrary methods from a string, and being able to catch method calls to non-existant methods.
<vodka-goo>
there would be no point in having a static check then :)
<Schmurtz>
dylan, like objective-c
<vodka-goo>
dylan: these kind of things are possible using black magic I believe
<Schmurtz>
it's strongly dynamic for member calls
<dylan>
Well, the static check is for the types (int, string, Hashtbl.t), but not for the objects.
<vodka-goo>
but the type system would be no use against such things
<dylan>
True, and you'd have to wrap the types somehow. It'd put a hole in the type checking.
<vodka-goo>
oo.magic_call : <..> -> string -> 'a
<vodka-goo>
on the other hand it doesn't look uglier than obj.magic :)
<dylan>
what I end up doing is lots of (string, string list -> unit) Hashtbl.t things.
<Schmurtz>
the obj.magic function should never be used
<dylan>
Except in queue.ml? :)
<vodka-goo>
Schmurtz: one shall never say never
<vodka-goo>
dylan: exactly
<Schmurtz>
it's just a way to create hacks
<dylan>
then I implemented inheritence...
<vodka-goo>
the good thing about it is that it breaks the type system in a "moderated" way only
<Schmurtz>
dylan, it may not be used in queue.ml
<vodka-goo>
Schmurtz: sometimes it's really better with Obj.magic
<Schmurtz>
it's just to simplify the code
<vodka-goo>
which is a nice sense of "better"
<Schmurtz>
and perhaps improve its performance
<Schmurtz>
vodka-goo, I agree
<Schmurtz>
but one have to have a good reason to use it
<Schmurtz>
has
<Schmurtz>
(must is even better...)
<pango>
I've seen Obj.magic used to "implement" abstract types in another module... :)
Bigb[a]ng is now known as Bigbang
* dylan
thinks this is the nicest channel he's been on in freenode. :)
<bluestorm>
do you know camlp4 ?
<dylan>
The lack of flaming is quite refreshing...
<dylan>
bluestorm: in general or the revised syntax?
<bluestorm>
hum
<bluestorm>
i mean
<bluestorm>
camlp4 in general
<bluestorm>
i tried to read the manual
<bluestorm>
but it is a little difficult to really understand
<bluestorm>
only from the manual
<dylan>
I tried to read the manual too. Didn't get very far.
<bluestorm>
(my english is not good enough)
<bluestorm>
hum
<bluestorm>
do you know
<bluestorm>
if i could use the quotation system
<bluestorm>
to do some odd web template system using ocaml ?
<dylan>
That is what I'd like to find out how to use.
<bluestorm>
i was looking for something to do it
<dylan>
caml_template not good enough?
<bluestorm>
hum
<bluestorm>
dunno caml_template
<bluestorm>
gonna look for it first
<bluestorm>
"Your search - caml_template - did not match any documents. "