Leonardo de Moura
3ac6eab393
chore(library/vm): remove vm_list
2018-10-02 08:44:05 -07:00
Sebastian Ullrich
a42fb533f4
fix(library/vm/vm_io): move all primitives into io
...
While `cmdline_args` has no side-effects, it is certainly not a pure function.
The `stdin` etc. should have been safe since all accessors are in `io`, but
better be safe than sorry.
2018-08-21 08:43:10 -07:00
Sebastian Ullrich
9db688f4c2
fix(library/{vm/vm_io,init/io}): fix bugs and tests
2018-08-21 08:43:09 -07:00
Sebastian Ullrich
a260bf91d4
refactor(library/vm/vm_io,library/system/io): remove io classes, make errors explicit
2018-08-21 08:43:09 -07:00
Leonardo de Moura
95f758d240
feat(library/system/io_interface): improve iterate interface
...
The new version is better for lifting.
2018-07-26 16:07:30 -07:00
Sebastian Ullrich
f254a906b3
fix(src/library/vm/vm_io): get_cwd
2018-07-05 10:53:07 +02:00
Leonardo de Moura
0556412f8d
refactor(*): add runtime folder
...
@kha The runtime folder includes what is needed to link a
standalone Lean program. It is still contains some unnecessary files.
We will be able to remove them after we release Lean4.
2018-05-14 14:23:56 -07:00
Leonardo de Moura
dde79a8783
fix(library/vm/vm_io): compilation warning
2018-05-03 10:30:39 -07:00
Leonardo de Moura
48ba4370d5
feat(library/system/io): implement io using string instead of char_buffer
2018-05-02 17:31:51 -07:00
Leonardo de Moura
1e11611388
chore(library): cleanup constants.txt
2018-04-12 16:43:11 -07:00
Leonardo de Moura
db4b00c7d8
chore(util,library): remove small_object_allocator
...
We use small_object_allocator to allocate vm_obj's.
However small_object_allocator is not thread safe. So, we need to copy
vm_obj's between threads. Moreover, in our experiments, we observed that
JEMALLOC is actually faster than the small_object_allocator.
Here are numbers for the reduced corelib.
small_object_allocator: 15.62 secs
gcc 4.9 allocator: 16.19 secs
jemalloc: 13.83 secs
2018-04-12 16:43:10 -07:00
Sebastian Ullrich
1c6861528b
refactor(init/category): move monad laws into separate type classes defined after the tactic framework
2018-03-20 14:58:35 -07:00
Nuno Lopes
9e42e434b5
chore(io): remove a few unneeded ref count bumps
2018-02-27 10:55:38 -08:00
Nuno Lopes
c67062644a
fix(io_proc): fix crash on Windows/VS when invoking external processes
...
This commit also removes a couple of unused functions
2018-02-27 10:43:09 -08:00
Leonardo de Moura
a115a1538b
chore(library/vm/vm_io): style
2018-02-15 16:25:17 -08:00
Leonardo de Moura
ac13f8b0f9
feat(library/system/io): add random number generator support in the io monad
...
@aqjune @nunoplopes: See new tests at tests/lean/run/random.lean
We have two actions in `io`. By default, `io` uses the C++
random number generator, but we can force it to use a `std_gen` with
the action `set_rand_gen`.
def rand (lo : nat := std_range.1) (hi : nat := std_range.2) : io nat
def set_rand_gen : std_gen → io unit
2018-02-15 16:12:08 -08:00
Nuno Lopes
46cfd33a1b
fix(build): attempt to fix linux buildbots
2018-02-06 10:11:10 -08:00
Nuno Lopes
50bc3b0314
fix(msvc): fix compilation of vm_io.cpp
2018-02-06 10:11:10 -08:00
Leonardo de Moura
0d83a74b26
fix(library/io,tests/lean): io monad command line arguments, and tests
2018-01-23 15:24:41 -08:00
Leonardo de Moura
0ad5497462
refactor(library/io): make io easier to extend and use
2018-01-23 15:03:31 -08:00
Sebastian Ullrich
2586f5b6f2
feat(system/io): get_cwd/set_cwd
2017-12-30 19:31:55 +01:00
Leonardo de Moura
4eefc41b6e
refactor(*): wrap string in a structure
...
We want to make sure string users do not depend on the string
implementation. This is the first step.
We need this refactoring *now* to make sure it will not be
super painful to address issue #1175
2017-06-07 17:30:49 -07:00
Leonardo de Moura
603bbe5987
fix(*): gcc 7 linking errors
2017-05-31 16:35:09 -07:00
Gabriel Ebner
b4c73e562e
fix(library/vm/vm_io): use correct memory layout for io.environment
2017-05-08 15:07:48 +02:00
Gabriel Ebner
f0d22ed3e5
feat(library/process,system/io): set environment variables for spawned processes
2017-05-04 16:41:11 -07:00
Gabriel Ebner
1b8533130b
feat(system/io): add function to get environment variables
2017-05-04 16:41:11 -07:00
Gabriel Ebner
44bfceb6a6
feat(library/process): support working directory on windows
2017-05-01 14:11:39 -07:00
Leonardo de Moura
470f2bc547
feat(library/compiler, library/vm): remove additional irrelevant information
2017-04-16 12:46:14 -07:00
Gabriel Ebner
cefc26d9cb
refactor(library/system/process): add exit status and working directory
2017-04-11 16:42:17 -07:00
Gabriel Ebner
e2fa363423
feat(library/system/io,shell/lean): add --run switch
2017-04-11 16:41:30 -07:00
Leonardo de Moura
6c68aeee01
feat(library/system/io): add io.iterate primitive
2017-03-31 11:34:09 -07:00
Jared Roesch
dc4086d0ed
feat(library/vm/process): add basic process support
2017-03-28 18:08:06 -07:00
Leonardo de Moura
70e6c380ed
fix(library/vm/vm_io): fix io_monad
...
see #1485
2017-03-27 13:42:08 -07:00
Sebastian Ullrich
c7b47c7b7f
fix(system/io): try to fix io monad
2017-03-27 13:42:08 -07:00
Leonardo de Moura
7db44ce403
chore(library/vm/vm_io): style
2017-03-23 16:58:28 -07:00
Leonardo de Moura
fe3875a103
feat(library/system/io): add stdin, stdout and stderr
2017-03-23 16:49:39 -07:00
Leonardo de Moura
82748a61b7
feat(library/system/io): basic file system API
2017-03-23 16:30:16 -07:00
Leonardo de Moura
527c8851a8
refactor(library/system/io): use type classes
2017-03-23 14:29:07 -07:00
Leonardo de Moura
60dd85719c
feat(library/system/io): system.io without axioms
2017-03-22 23:36:05 -07:00
Leonardo de Moura
839645c489
feat(library/system/io): replace io.monad with io.bind, io.return and io.map
2017-03-07 16:10:47 -08:00
Leonardo de Moura
2c0a5a5120
fix(library/compiler/erase_irrelevant): remove broken io monad optimization
...
It doesn't work when combined with inlining and common-subexpression-elimination
2017-02-07 21:24:31 -08:00
Jared Roesch
e65d90ac79
feat(*): C++ code generator
...
in progress move of Lean.native to init
2016-12-05 16:11:41 -08:00
Sebastian Ullrich
f10d5e4d8c
fix(library/vm/vm_io): disable get_line in server mode
2016-10-19 10:02:58 -07:00
Sebastian Ullrich
044b989679
fix(library/vm/vm_io): capture put_str/put_nat output in server mode
2016-10-19 10:02:58 -07:00
Leonardo de Moura
924f3629ee
feat(library/vm): expose name of the C++ functions that implement builtins
2016-06-02 12:48:43 -07:00
Leonardo de Moura
b31a7bd3e7
feat(library/vm): use cfunction style for nat and IO primitives
2016-05-31 17:22:27 -07:00
Leonardo de Moura
05837a2558
refactor(library/vm): move vm_obj <=> string conversion functions to separate module
2016-05-26 10:47:19 -07:00
Leonardo de Moura
53811822d4
chore(*): style
2016-05-25 18:10:15 -07:00
Leonardo de Moura
bf2d2b9feb
fix(library/vm,library/compiler,frontends/lean): IO monad support
2016-05-25 13:30:43 -07:00
Leonardo de Moura
e40c54013a
feat(library/vm): add basic support for IO monad
2016-05-24 17:52:22 -07:00