caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oliver Bandel <oliver@first.in-berlin.de>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] The Bridge Pattern in OCaml
Date: Fri, 28 Mar 2008 20:04:56 +0100	[thread overview]
Message-ID: <1206731096.47ed415833e07@webmail.in-berlin.de> (raw)
In-Reply-To: <91a2ba3e0803281123o68e86a1ej1d91f838c753232d@mail.gmail.com>

Hello,


Zitat von Raoul Duke <raould@gmail.com>:

> clueless question: are there languages which really can de/serialize
> arbitrary functions? Lisp?
[...]


Well, if one thinks about using a different language,
one possibly can find a lot of languages that support that feature,
but they do not have the advantage of OCaml's rigid type system.

One could use Perl with datadumper-moule, one can use
eval in perl and slurp in Code... I think this feature
was first invented in Lisp. I think this is powerful,
but also very easily exploitable.

Objective-C is not functional, but OO.
With the Cocoa-framwework one can write all
objects with their internal state to disk,
or send them vie network to another application.

But Apple decided to use Java instead of Objective-C.

Again thinking about the "implementing a language inside
a language possibly means to have to switch to a language that
provides the needed features of serialization, instead of
reimplementing it" does forget one argument: the type-sytem
of OCaml. Do the other languages provide such a system as
OCaml does? Swithcing to a less-rigid language could be
the easier task in the begining, but not in the long run.

This somehow is similar to things like code-injecting by eval()
in functions that provide this. For example, if you unchecked use
data from the outside (e.g. webpage) and eval(9 it directly,
this would be very problematic. better one should implement a
mini-language that parses it's arguments, and when the syntax (and
syntax also means the accepted keywords... for example a
system()-command that is not defined in the minilanguage would
let the parser fail, instead of inserting the code and executing it.

It's much harder to have a secure way of "accept all and then throw
away, what makes problem", instead of making "accept nothing, but allow
these keywords" secure. And this problem is somehow related to the
problem of "taking a language that offers the functionality already",
when this means that you then also have a lot of holes slurped in
(typesystem is too weak).

It's also possible to reinvent the weak wheel, when
one reimplements such weak languages on top of OCaml.
But if one insists on rigid checks, one could invent something new.
Something that works AND is easy to use.

BTW: Is there something like a LISP with type-checking like OCaml?
     Did someone have programmed something like that?


Ciao,
   Oliver


  parent reply	other threads:[~2008-03-28 19:04 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 16:29 Christopher L Conway
2008-03-19 16:51 ` [Caml-list] " Bünzli Daniel
2008-03-19 17:44   ` Christopher L Conway
2008-03-19 18:06     ` Christopher L Conway
2008-03-20  2:07       ` Yaron Minsky
2008-03-20 13:27         ` Martin Jambon
2008-03-20 20:10           ` Christophe Raffalli
2008-03-28 10:44         ` Jim Farrand
2008-03-28 11:06           ` Michael Wohlwend
2008-03-28 11:29             ` Jim Farrand
2008-03-28 11:57               ` Oliver Bandel
2008-03-28 11:30             ` Oliver Bandel
2008-03-28 11:45               ` Jim Farrand
2008-03-28 11:52                 ` Michael Wohlwend
2008-03-28 12:09                   ` Oliver Bandel
2008-03-28 12:43                     ` Jim Farrand
2008-03-28 18:23                       ` Raoul Duke
2008-03-28 18:29                         ` Robert Fischer
2008-03-28 18:34                         ` David Thomas
2008-03-28 19:14                           ` blue storm
2008-03-28 19:04                         ` Oliver Bandel [this message]
2008-03-28 19:05                         ` Mathias Kende
2008-03-28 19:47                         ` Jon Harrop
2008-03-28 23:24                           ` Oliver Bandel
2008-03-31  8:31                         ` Berke Durak
2008-03-29 14:03                       ` Peng Zang
2008-03-28 12:03                 ` Oliver Bandel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1206731096.47ed415833e07@webmail.in-berlin.de \
    --to=oliver@first.in-berlin.de \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).