Giter Site home page Giter Site logo

ravenbrook / mlworks Goto Github PK

View Code? Open in Web Editor NEW
177.0 177.0 19.0 30.89 MB

MLWorks is a Standard ML compiler and development environment.

Home Page: http://www.ravenbrook.com/project/mlworks

License: Other

Shell 1.15% Standard ML 80.04% OCaml 0.14% Perl 0.56% JavaScript 0.02% Ruby 0.01% C 14.23% C++ 1.28% OpenEdge ABL 0.09% Tcl 0.06% Emacs Lisp 0.56% Scilab 0.06% Assembly 1.38% Common Lisp 0.14% Awk 0.11% Racket 0.05% Objective-C 0.12%

mlworks's People

Contributors

nickbarnes avatar rptb1 avatar waywardmonkeys avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mlworks's Issues

RealArray in functor

This example

functor Foo (val update : RealArray.array * int * real -> unit) =
  struct
    val foo = update
  end

structure Foo = Foo (val update = RealArray.update);

val a = RealArray.array (3, 2.0)
val _ = (Foo.foo (a, 1, 1.0);
       if Real.== (RealArray.sub (a, 1),  1.0) then print "OK\n"
       else print ("WRONG (" ^ Real.toString (RealArray.sub (a, 1)) ^ ")\n"))

when executed with: mlworks -tty -no-init < test.sml
prints

MLWorks 2.1 Professional Edition
Copyright (C) 1999 Harlequin Group plc.  All rights reserved.
MLWorks is a trademark of Harlequin Group plc.

MLWorks> MLWorks>> MLWorks>> MLWorks>> MLWorks>> MLWorks>> functor Foo
structure Foo =
  struct
    val foo : (RealArray.array * int * real) -> unit = fn
  end
MLWorks> MLWorks> MLWorks>> MLWorks>> MLWorks>> MLWorks>> WRONG (7.9892357038E~312)
val a : RealArray.array = #F[2.0, 7.989235704E~312, 2.0]

the expected result is of course #F[2.0, 1.0, 2.0]

unix_bind doesn't handle INET addresses

The C function unix_bind in unix.c assumes that the argument is an address for a Unix Domain Socket.
The case when the argument is an INET address is not handled properly.

Static RTS does not build on Linux

On branch https://github.com/Ravenbrook/mlworks/tree/linux-boot, the runtime system currently fails to link statically with various unresolved symbols in X libraries. The symbols are actually in the libraries, so it might be a link-order problem.

See #2 for a list of prerequisite libraries you need to install.

I have been working on Ubuntu 12 i386, completely vanilla.

In 4799e00 I temporarily hacked the static runtime out of the makefiles so that we can make progress with the boot, but it's inconvenient to set LD_LIBRARY_PATH all the time when developing.

Internal compiler error

The compiler runs into a problem with this code even if it seems to be type-correct (SML/NJ and PolyML accept it):

functor Slice (type 'a elt
               type 'a seq
               val sub : 'a seq * int -> 'a elt) =
  struct
    datatype 'a slice = SLICE of 'a seq
    fun app f (SLICE s) = f (sub (s, 0))
  end

functor MonoSlice (type elt
                   type seq
                   val sub : seq * int -> elt) =
  struct
    structure S = Slice (type 'a elt = elt
                         type 'a seq = seq
                         val sub = sub)
    val app = S.app
    type slice = elt S.slice
    type elt = elt
  end

signature MONO_SLICE =
  sig
      type elt
      type slice
      val app : (elt -> unit) -> slice -> unit
  end

structure S : MONO_SLICE = MonoSlice (type elt = CharVector.elem
                                      type seq = CharVector.vector
                                      val sub = CharVector.sub)

For instance the interpreter stops with an "Exception Zip":

mlworks -tty
Use: /home/helmut/.mlworks
val it : unit = ()
MLWorks 2.1 Professional Edition
Copyright (C) 1999 Harlequin Group plc.  All rights reserved.
MLWorks is a trademark of Harlequin Group plc.

MLWorks> use "test.sml";
Use: /tmp/test.sml
functor MonoSlice
functor Slice
signature MONO_SLICE =
  sig
    type elt
    type slice
    val app : (elt -> unit) -> slice -> unit
  end
Entering Debugger, scanning stack ... done.
Exception Zip[_lists.sml:128.15-128.17] raised
Entering debugger, commands: q : quit (return to listener),  ? : more help
Current (innermost) stack frame:
No visible frame
Debugger> 

OS.FileSys.readDir conformance

Noticed a minor issue in the implementation of OS.FileSys.readDir,
According to sml-family

readDir filters out the names corresponding to the current and parent arcs.

I had not quite figured out how to generate the whole .ans file, etc

(* Result: FAIL *)
(* Test OS.FileSys.readDir, should return false. *)
fun hasParentOrCurrentArc() =
  let val cwd = OS.FileSys.openDir(OS.Path.currentArc)
      fun hasParentOrCurrentArc(d, flag) =
          let val entry = OS.FileSys.readDir(d)
              fun check(entry) = 
                String.compare(entry, OS.Path.parentArc) = General.EQUAL
                orelse String.compare(entry, OS.Path.currentArc) = General.EQUAL
              fun ent (SOME entry, false) = hasParentOrCurrentArc(d, check(entry))
                | ent (SOME entry, true) = true
                | ent (NONE, flag) = flag 
           in ent (entry, flag)
          end
   in hasParentOrCurrentArc(cwd, false)
  end
val a = hasParentOrCurrentArc();

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.