Commit graph

26 commits

Author SHA1 Message Date
Leonardo de Moura
a336176017 feat(runtime/io): improve "file not found" error message 2019-07-27 09:45:38 -07:00
Leonardo de Moura
a16df483fa fix(runtime/io): compilation error on windows 2019-07-26 10:09:55 -07:00
Leonardo de Moura
798bbc0662 feat(library/init/system/io): new primitives 2019-07-25 18:12:44 -07:00
Leonardo de Moura
02f516f09d feat(runtime/io): add primitives 2019-07-25 09:36:37 -07:00
Leonardo de Moura
77a59f4998 feat(library/init/io): add IO.getEnv 2019-07-25 08:31:23 -07:00
Leonardo de Moura
79545f55c0 feat(library/init/io): add IO.readTextFile 2019-07-18 17:31:31 -07:00
Leonardo de Moura
30a6a2ade8 feat(library/init/data, runtime): remove parray support from runtime, and implement them in Lean using Scala/Clojure Radix trees
The Scala/Clojure approach for persistent arrays works great with our
`reset/reuse`. We seem to be much more efficient than their
implementations because of `reset/reuse`. The new approach also seems
better than the old one implemented in the runtime, and has a few
advantages:
1- The reroot procedure used in the old approach required
synchronization for multi-threaded code, or we would need to perform
deep copies when sending `parray` objects between threads.
2- We don't need any runtime extension for the new approach.
3- The old approach used "trail lists" for undoing array updates.
This works well for bactracking search use cases, but it is bad
in use cases where we are simultaneously updating the persistent
arrays that have shared nodes.
2019-06-02 09:18:19 -07:00
Leonardo de Moura
53ec9ee181 chore(*): style 2019-05-14 07:08:58 -07:00
Leonardo de Moura
5844913102 feat(library/module, library/init/lean/environment): add primitives for reading/writing files as compacted regions 2019-05-13 17:26:28 -07:00
Leonardo de Moura
2cd2bec831 fix(init/init.cpp): initialization bug 2019-05-11 17:51:23 -07:00
Leonardo de Moura
c46608ced5 feat(library/init/io): implement unsafeIO in Lean
Motivation: avoid closure allocation.
2019-05-11 16:28:11 -07:00
Leonardo de Moura
fd2a5dd45e feat(library/init/io): add IO.initializing 2019-05-10 11:26:49 -07:00
Leonardo de Moura
d110a607fe fix(runtime/io): bug at IO.Ref primitives in multi-threaded mode 2019-03-23 09:06:04 -07:00
Leonardo de Moura
3202840959 fix(runtime/io): make IO.Ref thread-safe again
See new comment at `io.cpp`
2019-03-22 09:59:32 -07:00
Leonardo de Moura
a79b00d733 chore(runtime, stage0): update Ref primitive operation names 2019-03-21 16:43:54 -07:00
Leonardo de Moura
1da4782483 feat(runtime, library/init/io): add io.ref 2019-03-16 22:16:28 -07:00
Leonardo de Moura
b1c187f717 feat(library/compiler): allow io unit as main function result type
When `io unit` is used, we use `return 0` for `result.ok`, and `return
1` for `result.except`.
2019-03-16 16:05:45 -07:00
Leonardo de Moura
dcdeff1794 chore(runtime): remove dead file 2019-03-16 15:34:58 -07:00
Leonardo de Moura
6d0ec3a8c9 refactor(library/init/io): implement io monad using estate monad 2019-03-16 15:34:58 -07:00
Leonardo de Moura
0888dee25e chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
Leonardo de Moura
39dd079e37 feat(runtime): low tech allocation profiler
```
@[extern 4 "lean_io_allocprof"]
constant allocprof {α : Type} (msg : @& string) (fn : io α) : io α
```
2019-03-14 15:15:29 -07:00
Leonardo de Moura
562f530522 chore(runtime/io): use std::cerr 2019-03-14 11:04:12 -07:00
Leonardo de Moura
b722885137 feat(library/init/io): add unsafe_io and timeit 2019-02-13 16:59:24 -08:00
Leonardo de Moura
e10240fe5c refactor(runtime/io): use extern "C" for io primitives 2019-02-13 11:21:29 -08:00
Leonardo de Moura
434627ee8e chore(runtime/io): implement io.prim.put_str just to be able to test 2019-02-06 14:35:13 -08:00
Leonardo de Moura
3a7d407d6c feat(library/compiler/builtin): register io primitives
TODO: implement `io` primitives in the new runtime
2018-11-15 16:14:50 -08:00