Giter Club home page Giter Club logo

muse's Introduction

muSE - short for 'muvee Symbolic Expressions' - is a Scheme dialect intended for use as an embedded language. It has some unique language features such as first class macros, simple general read-time evaluation syntax, vectors and hashtables that can be used as functions, and extensive use of pattern matching bind.

Highlight: muSE is used as an embedded language to specify the "styles" in muvee Reveal, launched on 11 June 2008.

Language and library features

  • Provides lexically scoped closures as well as dynamically scoped blocks.
  • Expressive reader macro system where macros are first class citizens (i.e. can be passed around as arguments to functions, assigned to variables, etc.)
  • Uniform use of pattern matching for variable binding.
  • Generic functions (doc)
  • Many polymorphic primitives - including map, filter, reduce, get, put, and some others.
  • An extremely easy to use Objective-C bridge (only on MacOSX).
  • A simple module system.
  • Flexible exception handling
    • Resumable exceptions
    • Exception handler dispatch using pattern matching bind.
    • Simple cleanup mechanism
  • Reduce the need for local variables using TheAndIt.
  • Built-in support for JSON.
  • Built-in support for reading/writing a subset of XML.

Integration features

  • C-based, fairly well documented, simple embedding API. Can call as well as be called from C/C++ code.
  • Compact - Its easy to strip down the feature set to whatever subset of the core language you need.
  • Extensible notion of objects to add new kinds of things to muSE in native code. Vectors, hashtables and ports (for I/O) are provided using this mechanism.
  • Ability to add C/C++ based native functionality in the form of plugin DLLs.
  • Ability to create StandAloneExecutables
  • Supports multiple independent environments
  • Liberal license terms - can use in commercial applications without publishing source code.

License summary

The license agreement has been changed (13Nov2008) to "New BSD" with the requirement that contributions be made on the same terms.

Copyright

Copyright (c) 2006, Jointly owned by Srikumar K. S. and muvee Technologies Pte. Ltd.

muse's People

Contributors

srikumarks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ra80533 lwred

muse's Issues

Some compatibility with standard scheme idioms will be helpful in porting.

Though I don't think full R5RS compliance is expected or needed in muSE,
some compatibility is definitely possible without compromising the more
useful and general feature of muSE. 

1. (define ...) currently supports only (define f (fn (y) ..)) to define
functions. Supporting (define (f y) ..) as is done in standard scheme is
useful and nicer for creating nested and curried definitions such as
(define ((f x) y) ...) 

2. The scope of define should be restricted to the local lexical scopre of
fn, let and case. Currently define really can only be used to define global
entities. Introducing local variables using define is useful when
programming in the large.

Original issue reported on code.google.com by [email protected] on 29 Mar 2007 at 6:59

Message passing broken

What steps will reproduce the problem?
Sending a series of messages to another process will result in that process
receiving only the first message.
{{{
(define p (spawn (fn () (case (receive) (msg (write msg) ())))))
(p 'ping 0)
(p 'ping 1)
(p 'ping 2)
}}}

What is the expected output? What do you see instead?
Receiving process must receive all sent messsages in the sequence in which
they were sent.

Original issue reported on code.google.com by [email protected] on 8 Feb 2007 at 2:54

Problem with "apply" and tail call elimination

When apply is used in a non-tail position and the result of the apply is
itself a tail call, the tail call never gets forced.

For example -
(define g (fn (x) (print x)))
(for-each (fn (x) (g x)) '(1 2 3))

will end up doing nothing.

Original issue reported on code.google.com by [email protected] on 4 May 2007 at 1:50

Missing reverse and reverse! functions.

List reversal functions are useful when working with recursive functions.
If a recursive function builds a list of things, then on occasion you need
the reverse list, in which case an in-place reversal function reverse! is
very useful to have.

Original issue reported on code.google.com by [email protected] on 4 Aug 2007 at 5:15

Tail call elimination support wanted.

Curently, muSE is unable to define and use recursive procedures because it
doesn't support tail recursion - more generally tail call elimination.

To put in tail call elimination.

Original issue reported on code.google.com by [email protected] on 4 May 2007 at 10:56

Exception mechanism needs to be used by builtin functions

As of v338, the exception mechanism only kicks in if a coder uses the
try/raise/retry/finally expressions. Builtin functions currently don't
raise exceptions when unhandled conditions occur. They use some
idiosyncratic way of dealing with such conditions instead. 

All builtin functions should uniformly use the exception mechanism to deal
with .. well exceptional conditions.

Original issue reported on code.google.com by [email protected] on 4 Nov 2007 at 2:24

Need support for keyword arguments to functions

It is sometimes useful to specify arguments to a function in an order
that's different from the declared order. This may be required for a
different argument evaluation order, using default values, or using
argument bindings given as an association list. 

Original issue reported on code.google.com by [email protected] on 10 Jan 2007 at 2:22

Stand alone executables

It should be possible to distribute muSE based apps as stand-alone
executables. That will greatly aid its usability. 

1. Add a --exec flag to the REPL version of muSE to generate an executable.
2. If a "main" function is defined, then the created executable should
evaluate it, supplying the command line arguments as a list of strings. If
no main function is given, it should start the REPL.
3. Executables should be growable - i.e. you should be able to add more
definitions to an executable that already contains loaded muSE code.

Original issue reported on code.google.com by [email protected] on 17 Dec 2006 at 8:48

muSE r496 fails to compile on linux

When attempting to compile muSE r496 on linux via the build script
`build/posix/build', compilation fails with countless warning messages and
several errors. A brief summary of these messages follows, along with a
description of why the error occurred. Attached is the diff which was
necessary to build on linux, though I make no guarantees that the
formatting is to your liking, or the preprocessor catches all BSD-alikes.

1. A GCC warning about multicharacter expressions. Given that the text of
the ANSI standard lists these as implementation-defined instead of
undefined, this seems to be an odd quirk of GCC. It can be silenced with
-Wno-multichar.
2. A GCC warning about converting pointers to integers of different sizes.
The warning is slightly misleading, because a long long is at least long
enough to accomodate 64-bits of information as found in a pointer. It can
be silenced with -Wno-pointer-to-int-cast.
3. Compilation of muse_misc.c failed because the types of struct tm and
va_list were unknown. This occurs because the standard mandates that their
definitions be found in stdarg.h and time.h respectively, and including
them fixes the problem.
4. Compilation without optimizations to remove dangling functions may fail
on linking due to the lack of definition of those functions required by
muse_log outside of Windows. Conditionally compiling or even eliminating
this is the solution.
5. Compilation is aborted when sys/filio.h is not found, nor are the
definitions intended to be included from it, including SO_REUSEPORT. These
headers and definitions are a BSD extension, and are only found on
BSD-alike systems; ideally their near-analogues sys/ioctl.h and
SO_REUSEADDR should be used on POSIX-compliant, non-BSD systems.
6. Linking fails due to the absence of several math- and
dynamic-linking-related symbols, which _should_ be linked with explicitly.
7. The compiled muse binary fails immediately due to a 'double-free or
corruption' bug being detected by glibc in fclose. This occurs as the
is_muSEexec function closes its argument before returning, while the
calling function expects to close the FILE* itself.

Original issue reported on code.google.com by macdonellba on 27 May 2009 at 5:11

Attachments:

Segmentation fault

Hello.

I currently get segfaults with muSE when i try to cons a lot of cells.
Happens when consing more than 10.000 cells using a recursive procedure,
on a Win32 (XP) machine, using both v372 and v437 from the Downloads tab.

Original issue reported on code.google.com by [email protected] on 24 Apr 2009 at 9:38

Crash in GC for compute intensive runs

Run code that makes millions of function calls and you'll probably see a
crash in the GC. This bug is relatively rarely encountered during normal
execution of muSE. It usually features in compute intensive runs for
measuring performance.

Bug exists as of version 10 of the source.

Original issue reported on code.google.com by [email protected] on 12 Oct 2006 at 1:50

The REPL is broken.

The REPL in v108 (processes branch) is broken. It tries to read in all its
input in one go, which works for files but not for the REPL.

Original issue reported on code.google.com by [email protected] on 18 Dec 2006 at 1:44

The value part of a "let" binding cannot refer to an earlier value of the variable being bound.

What steps will reproduce the problem?
{{{
(define f
 (let ((x 1))
   (fn ()
    (let ((x (+ x 1))) x))))

(print (f))
}}}

What is the expected output? 
The printed result should be "2" because when the closure is created, the
value of "x" before the second let binding for x should be used in the
expression "(+ x 1)".

What do you see instead?
Instead you get a "+ cannot add a symbol and a number" kind of error.

Original issue reported on code.google.com by [email protected] on 8 Feb 2007 at 6:53

Higher order functions need to be consolidated

In revision 5 and before, only the higher order function "map" works as
intended on lists. 

1. Need to implement map, reduce and join for lists.
2. Extend the concepts to include vectors and hashtables.

Original issue reported on code.google.com by [email protected] on 25 Sep 2006 at 1:21

Resuming a raised condition does not work correctly if condition can be re-raised.

If a function that might raise a condition is called twice within a try
block, then the handler setup by the try block will only be invoked once if
it resumes the condition.

For example -
(try (f a b) (f c d)
  {fn: (ex . ..) (ex 'default)})
will cause the app to terminate with an unhandled exception if f raises the
condition in both invocations.

Original issue reported on code.google.com by [email protected] on 30 Mar 2007 at 4:33

No 64 bit support

There's a couple small bits of code in muse_platform.h related to stack 
handling that assume a 32-bit system. Here's a 64 bit x86 implementation that 
seems to work:

#if 1
#   define SAVE_STACK_POINTER( var ) \
            void *var = NULL; \
            asm("movq %%rsp, %0;" : "=r"(var));

#   define CHANGE_STACK_POINTER(sp_value) \
            do\
            {\
                void *new_sp = (void*)(sp_value);\
                asm("pushq %0; popq %%rsp;" : : "r"(new_sp));\
            }\
            while(0)
#endif

Original issue reported on code.google.com by [email protected] on 21 May 2012 at 2:52

Name change funcspec -> datafn

funcspec sounds funky for using to describe a function intended to be used to 
compute data values 
in a collection. "datafn" is more direct.

Original issue reported on code.google.com by [email protected] on 3 Jul 2007 at 5:15

Eliminate build warnings

A lot of build warnings are currently given by the VC2005 compiler. Need to 
eliminate them, fixing 
anything tha tmight be wrong about the code in the process.

Original issue reported on code.google.com by [email protected] on 3 Jul 2007 at 6:11

Provide pre-built binaries for a few platforms

1. Figure out an appropriate download location or wait for google to add a
release mechanism.
2. Build for MacOSX
3. Build for Win32

(I don't have a linux box. Anyone willing to do that can contact me.)

Original issue reported on code.google.com by [email protected] on 27 Oct 2006 at 1:23

Dynamically scoped sub-expressions don't work always.

Dynamically scoped sub-expressions, when used within closures must always
work. Currently they work only for the first closure created that contains
them. If another closure is created at an even higher level, the
dynamically scoped sub-expression doesn't evaluate correctly if it refers
to values supplied to the second closure.

Original issue reported on code.google.com by [email protected] on 25 Oct 2006 at 4:12

muSE is not truly embeddable

The muSE API make use of the notion of a "current environment" to which API
calls implicitly refer. This prevents multiple environments from being used
from multiple threads. Use and manage multiple non-interfering instances, etc.

This issue was reported by James McCartney. Thank you!

Original issue reported on code.google.com by [email protected] on 17 Jan 2007 at 1:10

Revision 16 -> Version 0.2a

A major update was made to muSE, which is available as version 0.2a,
starting from revision 16. Brief description -

1. Diagnostics facility added - which pops error messages under Windows and
prints them to stderr under unices.

2. Major revamp of higher order functions. They are now polymorphic over
lists, vectors and hashtables. You can use map, reduce, length etc. with
all of them.

3. All file line endings changed to unix-style line endings.

4. Hashtable bug fixes.

.. and etc. that I can't bother to describe here.



Original issue reported on code.google.com by [email protected] on 26 Oct 2006 at 5:41

Add build scripts for various platforms

Currently only the "build-posix" script exists for building on unices.
Though it is trivial to build muSE - just load all sources in your
favourite IDE and hit build - it'll be nice to have that ready for a few
platforms at least.

Original issue reported on code.google.com by [email protected] on 27 Oct 2006 at 1:16

Byte array read syntax is inconsistent with standard scheme for no reason.

As of v180 in muSE, in-stream byte arrays are notated as #nnnn[data].
Standard scheme notates it as #"data" with the length determined automatically.

I'd like to keep the explicit length while providing some compatibility for
using standard scheme-like byte strings. The explicit length version is
effective during transmission of large chunks of data 'cos there is no need
for escape codes.

Proposal: Support both #"blah" and #4"blah" notations for in-stream byte
arrays.

Original issue reported on code.google.com by [email protected] on 28 Feb 2007 at 10:49

sort and sort! functions are not stack friendly

What steps will reproduce the problem?
Use sort! or sort on a large list - over say 5000 elements. The stack will
blow.

What is the expected output? What do you see instead?
The sort should succeed.

Original issue reported on code.google.com by [email protected] on 9 May 2007 at 10:40

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.