Re: [Haskell-cafe] What is simplest extension language to implement?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 11/2/10 03:33 , Permjacov Evgeniy wrote: Forth is quite easy to implement, but can it be used as extension language? Wiki describes it as quite low level... It's low level but rather easy to build up more complex stuff. It's never been that popular in general due to its RPN nature, but is quite popular for extensions in low memory situations: it's *extremely* compact when compiled (that is, when source code consisting solely of word definitions is executed, the result is quite tiny). To give one example of the latter, look at FreeBSD's boot loader. - -- brandon s. allbery [linux,solaris,freebsd,perl] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon university KF8NH -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.10 (Darwin) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkzUq3sACgkQIn7hlCsL25UxZwCePgTpKGFnxZB+AJHugIAkXSbd FTUAnjl2FJEjyp9bxr3rh3Nmql3O0y22 =ncJH -END PGP SIGNATURE- ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible. We give Haskell as a embedded scripting language to non-programmers, and they love it. They especially like the strong typing, which finds their bugs before they ever get the chance to run their script. The terseness and lack of similarity to other programming languages is another benefit. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On Thu, Nov 4, 2010 at 5:30 AM, Malcolm Wallace malcolm.wall...@me.com wrote: ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. Do tell. It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible. We give Haskell as a embedded scripting language to non-programmers, and they love it. They especially like the strong typing, which finds their bugs before they ever get the chance to run their script. The terseness and lack of similarity to other programming languages is another benefit. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. Even the program which is to run the scripts is compiled with GHC? I am interested to know how you do that. 2010/11/4 Malcolm Wallace malcolm.wall...@me.com ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible. We give Haskell as a embedded scripting language to non-programmers, and they love it. They especially like the strong typing, which finds their bugs before they ever get the chance to run their script. The terseness and lack of similarity to other programming languages is another benefit. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On 4 Nov 2010, at 17:52, Luke Palmer wrote: On Thu, Nov 4, 2010 at 5:30 AM, Malcolm Wallace malcolm.wall...@me.com wrote: ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. Do tell. Well, our solution is not entirely off-the-shelf, and possibly not to everyone's taste or ability, but we wrote our own Haskell compiler, and a bunch of auto-generation tools (and FFI magic) that expose the underlying application's APIs (written in both Haskell and C++) as import-able modules into the scripting-Haskell layer. When I say we, of course I mean Lennart, who may have some previous experience in writing Haskell compilers... But this one is based on many freely available packages like haskell- src-exts and uniplate, so lots of the hard work had already been done for us. And who knows, perhaps one day enough of the other parts of a basic compiler (name resolver, type checker, translator to core) might appear in Hackage to make it easy for anyone to write their own scripting engine. Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
ehm. I missed something and ghc api is well documented and stable ? There are other ways of adding Haskell as a scripting language - bundling ghc is not necessary. I still have not found haskell interpreter, that is written in pure haskell and has good quality (i.e. stable, written in stable subset of ghc haskell, is small and so on). I know, that there is haskell-src(-ext), but interpreter (or at least compiler to ext-core) is needed. However, it may be a way... if no other will be found. It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible. We give Haskell as a embedded scripting language to non-programmers, and they love it. They especially like the strong typing, which finds their bugs before they ever get the chance to run their script. The terseness and lack of similarity to other programming languages is another benefit. I loved it as well and I was not programmer at that moment. However, I spent about 30-40 evenings to learn it well enough. I wish language, that can be learned in 3 evenings and used well enough for 3 days of work... And many of it's fetures are not standardized yet. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] What is simplest extension language to implement?
Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Ehm... Forth? TCL? Отправлено с iPhone Nov 2, 2010, в 9:04, Permjacov Evgeniy permea...@gmail.com написал(а): Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Forth is quite easy to implement, but can it be used as extension language? Wiki describes it as quite low level... TCL ... Well, I'll consider it if it have written standart, like RxRS does. On 11/02/2010 09:31 AM, Miguel Mitrofanov wrote: Ehm... Forth? TCL? Отправлено с iPhone Nov 2, 2010, в 9:04, Permjacov Evgeniy permea...@gmail.com написал(а): Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
I haven't ever used it myself, but I've heard good things about Lua, which was designed to be an embedded scripting language for applications: http://www.lua.org/ If you believe the Programming Language Shootout (http://shootout.alioth.debian.org/) it is pretty fast for a dynamic interpreted language, though JavaScript is much faster since the latter has more companies piling work into making it fast. Cheers, Greg On 11/1/10 11:04 PM, Permjacov Evgeniy wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Or maybe Lua? There is already a Lua binding on Hackage. I've been advised to use it when I was also looking for a scripting language (and disadvised to use Scheme). 2010/11/2 Permjacov Evgeniy permea...@gmail.com Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Norman Ramsey has implemented Lua as an extension language for ML, this included actually writing a Lua interpreter not FFI-ing to the standard Lua. He has a series of good papers about the mechanics of exposing the API of an application to the scripting language. The code itself is available as part of the C-- compiler suite. Clean has Esther which is similar in spirit with a paper describing its implementation, the code is in the standard distribution of Clean though I think it has diverged a bit from the paper. Finally if you end up considering Forth, Jerzy Karczmarczuk has a nice paper describing implementations of stack languages very succinctly in Haskell. http://www.cs.tufts.edu/~nr/ http://www.win.tue.nl/ipa/archive/falldays2003/vWeA2003-Esther.pdf http://users.info.unicaen.fr/~karczma/arpap/Fdpe02/fumach.pdf ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) 2010/11/2 Lennart Augustsson lenn...@augustsson.net I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
ehm. I missed something and ghc api is well documented and stable ? The problem is that haskell is overkill here and it requires esoteric extensions for some tasks (Rank2Types for reflection, for example). It is inacceptable for scripting language, faced to no-programmers. Such languages must be as plain and regular, as possible. So, statically typed languages are out of consideration: they either have poor expressive power, or have expressive, but complex type system (as haskell), or relies on hacks within language for some tasks(typecasts and duck typing in c++). Scheme may be acceptable, and possibly EcmaScript. I do not know any other acceptable standartized language. Yet, Scheme has really ugly synthax and Ecma-262 standard is 250 pages long (Of course, it is not C++ with about 1000 pages in standart, but it still hurts to read 250 pages of techdocs in foreign language). On 11/02/2010 12:21 PM, Lennart Augustsson wrote: I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On 11/02/2010 10:40 AM, Yves Parès wrote: Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) Isn't there a way to use some stripped-down version of ghc and the base libraries, providing only what the user really needs, in versions which are known to work, and supply that together with the application? I'd love to use haskell as a configuration language, provide some combinators and effectively get the rest for free. But it is not acceptable for a user to go through the mess of installing a ghc environment on, say, Windows, only to change some settings. 2010/11/2 Lennart Augustsson lenn...@augustsson.net mailto:lenn...@augustsson.net I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com mailto:permea...@gmail.com wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Yves Parès schrieb: Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) Hugs is great for running small Haskell scripts. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On Tue, 2 Nov 2010, Henning Thielemann wrote: Yves Parès schrieb: Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) Hugs is great for running small Haskell scripts. I like to add: Especially 'runhugs' runs a Haskell program in contrast to the interactive session of 'hugs'. You can also run Haskell programs with 'runghc' but this needs more startup time and GHC certainly demands more resources. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Clojure! Sent from my iPad On Nov 2, 2010, at 2:31, Miguel Mitrofanov miguelim...@yandex.ru wrote: Ehm... Forth? TCL? Отправлено с iPhone Nov 2, 2010, в 9:04, Permjacov Evgeniy permea...@gmail.com написал(а): Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Quoth Henning Thielemann schlepp...@henning-thielemann.de, Hugs is great for running small Haskell scripts. The quotes around scripts are well chosen, since it sounds like you might be using the word in a different sense of `small program', vs. the extension language notion of a programmable UI. Haskell's suitability for something like this has come up before. The worries about its complexity and giant learning curve seem misplaced to me - as a scripting extension it would have less to do, so there would be less to learn, I think - but it's all hand-waving without more concrete ideas about the typical application. And it's a moot point if there's no way to do it. Donn Cave, d...@avvanta.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Henning Thielemann, Tue, November 2, 2010 6:11:02 AM Yves Parès schrieb: Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) Hugs is great for running small Haskell scripts. Does Hugs provide an API for using it as an embedded interpreter? Hugs might be sufficiently lightweight, but from quickly skimming the docs it doesn't seem to be well documented. Incidentally, I'd like to know how to use the GHC API to evaluate expressions in terms of an existing context (and given that, if it's possible to preserve a value across reloading a module). Browsing the API documentation and trying to read the source for ghci has been unsuccessful - even a pointer to the critical bit in ghci would be helpful. Brandon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On Tue, Nov 2, 2010 at 11:08 AM, Donn Cave d...@avvanta.com wrote: The quotes around scripts are well chosen, since it sounds like you might be using the word in a different sense of `small program', vs. the extension language notion of a programmable UI. Haskell's suitability for something like this has come up before. The worries about its complexity and giant learning curve seem misplaced to me - as a scripting extension it would have less to do, so there would be less to learn, I think - but it's all hand-waving without more concrete ideas about the typical application. And it's a moot point if there's no way to do it. If (and this is a big if) the type of extensions you want the user to provide are well captured in a simple combinator-style DSL you can write an AST and interpreter for, then as a first pass Read/Show over the AST is sufficient. If the syntax and parser messages are too confusing, then a parsec-based parser can get you the rest of the way. Once you grok the principles, writing your own functional mini-language in Haskell (including as an external DSL) is in many ways more straightforward than binding to any sort of external runtime. That said, some sort of slow but low-footprint mini-hask for extension languages would be pretty awesome. I'm seeing a function like -- evalMiniHask :: Environment - String - Either ParseOrTypeError Dynamic. where type Environment = ([DataRep], [FunctionRep]) and type DataType = (String,TyCon,Dynamic) -- the latter being the concrete type constructor, wrapped in a dynamic type FunctionType = (String, TypeRep, Dynamic) -- the latter being the concrete function, wrapped in a dynamic I can see a number of use cases in my own code already Cheers, Sterl. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
On 2/11/2010 9:05 PM, Steffen Schuldenzucker wrote: On 11/02/2010 10:40 AM, Yves Parès wrote: Because he would have either to recompile the whole program or to use things like hint, both implying that GHC must be installed on the user side (600Mo+ for GHC 6.12.3) Isn't there a way to use some stripped-down version of ghc and the base libraries, providing only what the user really needs, in versions which are known to work, and supply that together with the application? there is hugs, which is a small, fast haskell interpreter. It is embeddable ( exposes a C api for embedding - it is written in C), supports many language extensions and can be stripped down (in terms of libraries) as far as you like, but is now often forgotten, overlooked in so far as haskell implementations go. I'd love to use haskell as a configuration language, provide some combinators and effectively get the rest for free. But it is not acceptable for a user to go through the mess of installing a ghc environment on, say, Windows, only to change some settings. 2010/11/2 Lennart Augustsson lenn...@augustsson.net mailto:lenn...@augustsson.net I don't understand. Why don't you use Haskell as the scripting language? On Tue, Nov 2, 2010 at 7:04 AM, Permjacov Evgeniy permea...@gmail.com mailto:permea...@gmail.com wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? R(4/5/6)RS ? EcmaScript ? Some other ? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is simplest extension language to implement?
Hello Permjacov, Tuesday, November 2, 2010, 9:04:00 AM, you wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? http://www.haskell.org/haskellwiki/HsLua or python -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe