I've decided to offer a 200 USD bounty for implementing "ClojureScript" (a
tentative name), a Clojure API and a convenient command line utility for
performing quick system admin tasks, text manipulation tasks, command line
scripting, etc. similar to the use cases of bash/awk/sed or bash along with
/usr/bin/perl . If you're interested in doing this let me know.
Motivation:
-----------
For a long time, I've desired a usable and popular dialect of Lisp, which was
the promise of Paul Graham's Arc ( http://www.paulgraham.com/arc.html ) and of
several other attempts, including some of my own attempts nicknamed "Park" and
"Spark". Now, it seems that the most trendy dialect of Lisp has become
Clojure, and while I challenge some of its design decisions, it seems pretty
nice.
One of the things that make a language popular and likable is its utility for
quick-and-dirty tasks. For further motivation please see:
* http://www.paulgraham.com/popular.html
* http://www.paulgraham.com/power.html
* http://www.shlomifish.org/philosophy/computers/perl/joy-of-perl/
* http://xoa.petdance.com/Stop_saying_%22script%22
* http://www.joelonsoftware.com/articles/FiveWorlds.html - see what he says
about "throwaway" code vs. inhouse code vs. "shrinkwrap" code.
* http://www.perl.com/pub/2007/12/06/soto-11.html - Larry Wall's "Programming
is Hard, Let's Go Scripting".
*
http://perl.org.il/presentations/larry-wall-present-continuous-future-
perfect/transcript.html
(short URL - http://xrl.us/bhks6t ).
* http://perl.plover.com/yak/12views/samples/notes.html#sl-39 - titled "Why
Lisp Will Never Win" - comparing and contrasting Common Lisp to Awk and Perl.
---
How to do it:
-------------
The one who will perform the task, will look at the scripting capabilities of
Perl 5, Ruby, Perl 6, Python, Bash and zsh (one can use Freenode for asking
questions about them) and will devise a specification for implementing
something similar in Clojure.
Afterwards, they will implement it as a user-land, high-level API above
Clojure with a simple command line front-end tentatively called "lurk", which
will be useful for it. Once completed, they will get the money, and credit.
The licence of the newly written code has to be the MIT/X11 licence (see:
http://en.wikipedia.org/wiki/MIT_License ) or a similar permissive licence
compatible with both the GPLv2 and the GPLv3.
Please let me know if you have further questions. You can contact me in
various ways here:
http://www.shlomifish.org/me/contact-me/
(I prefer either one of my Jabber accounts or MSN as IM, and I don't always
have IRC on.)
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Why I Love Perl - http://shlom.in/joy-of-perl
Modern Perl - the 3-D Movie. In theatres near you.
Please reply to list if it's a mailing list post - http://shlom.in/reply .
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
On Mar 4, 2011, at 4:29 AM, Shlomi Fish wrote:
> a Clojure API and a convenient command line utility for
> performing quick system admin tasks, text manipulation tasks, command line
> scripting, etc. similar to the use cases of bash/awk/sed or bash along with
> /usr/bin/perl
I've actually come to think that perl may be a great Clojure host language; the result would presumably be useful in the ways you've described. I presume someone who actually knows perl well will beat me to implementing it.
Good luck with your project,
- Chas
Or you could just hoist the entire shell up into the JVM ...
Let's see ...
(def wd (atom (java.io.File. "/")))
(defn pwd [] @wd)
(defn file [thing]
(if (instance? java.io.File thing) thing (File. (pwd) thing)))
(defn cwd [f]
(let [f (file f)]
(if (.isDirectory f)
(reset! wd f)
(throw (IllegalArgumentException. (str "No such directory: " f))))))
(defn ls [& opts]
...
:)
> Many common OS-level features -- launching processes and
> sending signals, for example -- are not available in the standard Java APIs,
> and require the use of native code or implementation-specific APIs.
Er, (.exec (Runtime/getRuntime) "foo") anyone? And that includes
(.exec (Runtime/getRuntime)
(str "kill -s SIGALRM " get-some-pid))
of course. :)
> I'm not saying it can't be done, just that there may be better tools for the
> job.
After a little macro wizardry, that might actually turn out not to be
true. I certainly wouldn't categorically rule it out. :)
Talk about Beauty and the Beast ... ;)
> There are difficulties with using Clojure -- or any JVM language -- for
> system administration. The first and biggest is the JVM startup time,
> making it impractical for command-line use without a separate "server"
> process.
One possibility to improve Clojure startup time would be to compile it
into a native binary with GCJ. Yet the current version of GCJ fails to
compile Clojure. Also this will likely degrade overall performance as JIT
allows more optimizations.
--
Mikhail
The first and biggest is the JVM startup time,
thanks for your insights.
Well, we can later on re-use or define a common API for doing such stuff on
the JVM similar to what perl 5, CPython or CRuby offer by default, and make
sure it is usable.
Regarding the JVM start up time - yes it may be a problem. I was once told
than in JDK-1.5.x the problem was fixed, but I'm not sure if it's true. And if
we see this is a problem in Clojure, we can always opt for writing a new
implementation of Clojure for a different host VM which is better in this
respect. Nevertheless, I think that Clojure would make the best starting-point
for a modern Lisp-based scripting tool.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
Understand what Open Source is - http://shlom.in/oss-fs
Larry Wall applies a patch manually quicker than GNU patch.
On Friday 04 Mar 2011 21:08:03 Mark Rathwell wrote:
> >> I've decided to offer a 200 USD bounty for implementing "ClojureScript
>
> I think you are missing a couple zeros in your offer price ;)
>
:-) .
Well, code bounties do not tend to cover all of the time of writing the
program, and are more of a motivation. I worked on several O'ReillyNet
articles for about that amount, and again it was not enough to reimborse me
for all the work, but it was good enough for me. Randal Schwartz (of Perl 5
fame) said that working on a technical book is a lot of work and earns only
slightly above minimum wage:
http://www.perlmonks.org/?parent=458151;node_id=3333
Recently, a translator I contacted on the hebtranslators YahooGroups mailing
list volunteered to copy-edit the Hebrew version of my story "The Enemy and
How I Helped to Fight it", which is pretty long, in exchange for a shirt and
less than 100 USD (but naturally also other possible perks like giving her
thanks and credit and a link), and she detected many problems.
As Paul Graham notes here: http://www.paulgraham.com/opensource.html - the
word "amateur" used to mean someone who loves what he does, and many people,
including many open source enthusiasts and most bloggers do, despite the fact
that they don't always get paid for what they do.
What I'm trying to say is that I don't expect my 200 USD to cover all the
work, but I expect it to be a nice motivation for someone, who is more
knowledgable in Clojure and its good style, than I am, to perform some of the
work
.
> Seriously though, these things tend to go better when you say something
> like "I've decided to work on this new project, who wants to help?",
> instead of offering a very small reward and seeming as though you are not
> willing to do any of the work.
You may be right. I should note that I'm willing to offer some ongoing help
with the project (contact me via IM at
http://www.shlomifish.org/me/contact-me/ ), but I still don't feel confident
enough in doing it myself. I am a capable programmer, but I'm also kinda lazy
and think someone here could benefit from it.
I've seen much smaller bug bounties than 200 USD, BTW, and I may opt to
increase the amount, given enough interest.
Regards,
Shlomi Fish
"Star Trek: We, the Living Dead" - http://shlom.in/st-wtld
God gave us two eyes and ten fingers so we will type five times as much as we
read.
thanks for your E-mail.
On Friday 04 Mar 2011 21:29:37 Armando Blancas wrote:
> Have you look at Scsh?
>
> http://www.scsh.net/about/what.html
>
> It's not the most trendy, but being a Scheme at least is nice.
>
I've learned some SICP Scheme as part of reading the SICP courses and later on
taking the two courses as part of my University B.Sc. (which proved to be
enlightening on their own right, because when I read the book, I skipped over
the exercises.). I see several problems with Scheme:
1. The standard library does not define or did not define many important
primitives for handling files and directories, sockets, and other high level
APIs: for GUIs, for writing server-side web-scripts (CGI/etc.), for unified
database access (SQL/etc.), for client-side HTTP programming, etc. There are
some implmentation-specific extensions for various Scheme implementations, but
they are few and far between and don't reach the scope of Perl's CPAN or the
Java Standard Library along with third party extensions such as Apache's
Jakarta.
2. There are several competing Scheme implementations. While most Scheme
implementations out there are sort of a proof-of-concept or rite-of-passage
for every programmer (see:
http://www.shlomifish.org/humour/bits/Programs-Every-Programmer-has-Written/ )
there are still a proliferation of some highly developed ones which compete
for the same mindshare and offer incompatible APIs.
3. The Scheme core language is very verbose by default. (My favourite Scheme
expression is «(vector-set! myarray idx (1+ (vector-ref myarray idx)))». While
this verbosity can be mitigated by writing many functions and macros, it still
has a lot of initial overhead and as Larry Wall notes "programmers hate
abstractions." and want things to be usable by default.
4. Finally, I should note that in general Scheme has a very impractical feel
to it, and one gets the impression that they cannot use it for anything that
is useful on a day to day programming. Read the links in the original message
for more about that.
Maybe it's just a feeling.
-------------------------------
It seems that Clojure fares better on all of these points, so I think it can
be a better basis for a scripting language.
> Anyone capable of doing the job properly either won't take any money
> or won't come cheap, so you might be better of offering a round of
> beer or request bids.
>
If you want to do it in exchange for a T-shirt (your choice) and/or a beverage
of your choice, then all the power to you. I can donate the money to ${their
favourite charity}.
Regards,
Shlomi Fish
[Trimming the quoted message].
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs
My Commodore 64 is suffering from slowness and insufficiency of memory, and
its
display device is grievously short of pixels. Can anybody help? -- Omer Zak
:-)
Well, to quote Larry Wall from here:
http://perl.org.il/presentations/larry-wall-present-continuous-future-
perfect/transcript.html
(short URL - http://xrl.us/bhks6t )
<quote>
I simultaneously believe that languages are wonderful and awful. You have to
hold both of those. Ugly things can be beautiful. And beautiful can get ugly
very fast. You know, take Lisp. You know, it's the most beautiful language in
the world. At least up until Haskell came along. (laughter) But, you know,
every program in Lisp is just ugly. I don't figure how that works.
</quote>
Cheers.
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
"Star Trek: We, the Living Dead" - http://shlom.in/st-wtld
Oh! I wish you could see the look on his face! Actually, I would have also
liked to see the look on his face, but just then I woke up from the dream.
-- "The Enemy and how I Helped to Fight It"
On Friday 04 Mar 2011 21:32:31 Chas Emerick wrote:
> FYI, "ClojureScript" is generally taken to be the name of a
> Javascript-hosted runtime for Clojure. Anyway…
>
Yes, well, it was just a tentative name. I thought of calling it "lurk" or
"lurking" as well (descended from "Arc" -> "Park" -> "Spark" -> "lurk"). But a
rose by any other name, etc.
> On Mar 4, 2011, at 4:29 AM, Shlomi Fish wrote:
> > a Clojure API and a convenient command line utility for
> > performing quick system admin tasks, text manipulation tasks, command
> > line scripting, etc. similar to the use cases of bash/awk/sed or bash
> > along with /usr/bin/perl
>
> I've actually come to think that perl may be a great Clojure host language;
> the result would presumably be useful in the ways you've described. I
> presume someone who actually knows perl well will beat me to implementing
> it.
>
Do you mean perl 5 or Parrot (the VM for Rakudo Perl 6 and many other
languages)? Maybe both naturally.
> Good luck with your project,
>
Thanks! :-).
Regards,
Shlomi Fish
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
List of Portability Libraries - http://shlom.in/port-libs
Chuck Norris is the greatest man in history. He killed all the great men who
could ever pose a competition.
> On Mar 5, 2:17 am, Shlomi Fish <shlo...@iglu.org.il> wrote:
>
>>> On Mar 4, 2011, at 4:29 AM, Shlomi Fish wrote:
>>>> a Clojure API and a convenient command line utility for
>>>> performing quick system admin tasks, text manipulation tasks, command
>>>> line scripting, etc. similar to the use cases of bash/awk/sed or bash
>>>> along with /usr/bin/perl
>>
>>> I've actually come to think that perl may be a great Clojure host language;
>>> the result would presumably be useful in the ways you've described. I
>>> presume someone who actually knows perl well will beat me to implementing
>>> it.
>>
>> Do you mean perl 5 or Parrot (the VM for Rakudo Perl 6 and many other
>> languages)? Maybe both naturally.
I am an absolute noob with perl at the moment, so I have no advice or concrete plans to offer. However, regardless of the specific runtime one chooses, it seems to me that the perl ecosystem has a lot in common with the Java ecosystem w.r.t. abundance of libraries, widespread tooling and deployment support, etc etc. The fact that the host language is vibrantly alive in all the important ways is a big plus too.
> There are some interesting alternatives to JVM worth considering to
> implement (a viable subset of) Clojure:
>
> 1. V8 JavaScript Engine
> 2. Parrot VM
> 3. Guile 2.0 (Clojure can be a front end)
Parrot + Perl 6 is obviously reasonable. Same for guile, or any sane scheme environment. The problem with schemes is that their communities and selection of libraries are (relatively) small. V8 doesn't make any sense to me; perhaps the VM itself is sound, but (AFAIK) it's not even nominally general-purpose and there's no libraries or community.
- Chas