Discussions

News: Sleep 2.0, scripting language, released

  1. Sleep 2.0, scripting language, released (9 messages)

    Sleep 2.0 has been offically released. Sleep is a perl-inspired scripting language for Java.

    Sleep's old design goals consisted of creating a language that was easily extensible and embeddable into an application. Once these goals were accomplished, work on Sleep 2.0 started. Sleep 2.0 took the simple Sleep language and brought it forward into a powerful and full featured general purpose scripting language.

    Major features in Sleep 2.0
  2. HOES Subsystem - access the Java API from Sleep
  3. Binary data manipulation - easily extract/parse binary data
  4. Multidimensional data structures - easily organize data
  5. Closures - apply functional programming techniques within scripts
  6. Sleep 2.0 can be downloaded at: http://sleep.hick.org/ and an introduction to the language can be found at: http://today.java.net/pub/a/today/2005/07/14/sleep.html.

    How do you think Sleep compares to Python, Groovy, or the other scripting languages available for Java?
  • I'm sure he thanks you.
  • What's wrong with Jython?[ Go to top ]

    How is this different thatn Jython?
  • What's wrong with Jython?[ Go to top ]

    How is this different thatn Jython?
    Python is not Perl ;-)
  • It honestly doesn't look much like Perl to me. Can someone explain to me the supposed similarity?

    It seems too verbose to really be called "Perl-like".
  • It honestly doesn't look much like Perl to me. Can someone explain to me the supposed similarity?It seems too verbose to really be called "Perl-like".

    It's also much too readable and easy to follow to be comparable with Perl.
  • new language[ Go to top ]

    Be sure to check out Cooveython, a new scripting language for Java with COBOL like syntax. It supports arrays, hashmaps, and annotations.
  • Not all that Perl-like..[ Go to top ]

    What I like about Perl is the built-in power not the fact that I can use APIs written in other languages.

    Perl is great for writing tight text manipulation task with few lines of code.

    From what I see of Sleep you are writing almost the same amount as you would if you used a RegEx API in Java.


    My two cents,

    Travis Gibson
    http://www.travismgibson.com

    P.S.
    I only write code in languages that I can get paid for.
  • what was the motivation?[ Go to top ]

    i'm in doubt the necessity of such a language exists, what thereal bonuses it promises?
    also, the version is 2.0 - so do any successful "Sleepy" projects exist?

    Alexander
  • Quick warning, I'm the post of the original message, so beware of any bias below. Second thing, thanks for the comments, feedback is always good. :)

    As some folks have mentioned the big strength of Perl is the built-in stuff in the language. This is the same case with Sleep. I don't have a lot to say for the regex bridge, I mean it's a regex bridge? How could one make a higher level abstraction than what is there... you look for matches and extract stuff from matches. Problem solved :)

    One thing about a lot of Java based scripting languages is they use reflection to map the entire Java API 1:1. The authors then say "hey check out my language, it has all this sugar, and tastes great". Usually you then end up getting a lot of great sugar like leaving out semi-colons or parentheses :) but not much in the way of new abstractions for common stuff. i.e. the API still follows the Java API with some sugar sprinkled on. (Read: you still need to be a Java programmer, ok I'm speaking about groovy here, I am a fan of the project :)).

    Sleep provides an interface for accessing the Java API 1:1, however it is not a mainstay of most scripts. I rarely use it unless I'm scripting a SwingUI. In which case a module is in the works to allow working with the Java API at a higher level.

    Sleep provides some of the same abstractions for tasks that Perl does. I'm particuarly proud/happy with how the I/O interface came out. I can write programs using Sleep to parse, output, and work with binary data that I would not want to write using Java. i.e. the wtmp file parsing example.

    The 2.0 dev cycle of Sleep was all about adding features to make Sleep more on par feature wise with other scripting languages. The original goal of the project has not changed. Sleep is a scripting library for providing an embedable scripting solution for end users. In particular end users who do not necessarily know Java.

    Someone asked earlier if Sleep is being utilized successfully in a project. The answer is, yes. I use Sleep as the scripting library for an internet relay chat client, jIRCii. I've used this interface to add several new features to the program that I didn't want to hard code in. Besides myself there is quite an active scripting community behind this little application representing a range of skill levels. There are a few folks who know Java but for the most part the community is novice programmers. I have one user whose in progress script amounts to more than 5000 lines of code (adding every feature imaginable).

    Sleep was written to scratch an itch and in terms of the jIRCii community it has been very successful. With the launch of Sleep 2.0 my goal is to share a solution that worked for one of my projects with the rest of the Java community.

    http://jircii.hick.org <-- jIRCii website