Commit graph

4300 commits

Author SHA1 Message Date
Leonardo de Moura
64a43e1976 chore(library/init/control/combinators): use namespace 2019-03-21 15:11:05 -07:00
Sebastian Ullrich
6988a8e69a fix(library/Makefile): avoid half-finished .cpp files 2019-03-21 15:11:05 -07:00
Sebastian Ullrich
a9416b722d chore(library/Makefile): move extracted .cpp files back to src/stage1/ so that we can share them between build configs 2019-03-21 15:11:05 -07:00
Leonardo de Moura
7982420d8d fix(library/init/lean/expander, frontends/lean/lean_elaborator): conversion issues 2019-03-21 15:06:46 -07:00
Leonardo de Moura
930164b597 chore(library/init/lean/parser/term): remove hack used during conversion 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
cf72e97455 chore(library): capitalize more Props 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
c786673837 chore(library/init/core): more renaming 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
7615c9f92f chore(library/init/core): style review of the first half 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
d5ec4a4606 chore(frontends/lean/pp): ppAnonymousCtor -> ppAsAnonymousCtor 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
b9edaf888f chore(library/init/core): ne -> Ne, not -> Not 2019-03-21 15:06:45 -07:00
Sebastian Ullrich
97e5aa2411 chore(library): s/Punit/PUnit/g etc 2019-03-21 15:06:45 -07:00
Leonardo de Moura
1b1946f0e0 fix(library/init/lean/expander): unit => Unit 2019-03-21 15:06:45 -07:00
Leonardo de Moura
11688fd813 fix(library/init/lean): [export...] 2019-03-21 15:06:44 -07:00
Leonardo de Moura
430bbef6d7 chore(*): minor 2019-03-21 15:06:44 -07:00
Leonardo de Moura
1fe3f14ad0 chore(*): Uint => UInt, Usize => USize 2019-03-21 15:06:44 -07:00
Leonardo de Moura
79a8d9aa65 chore(*): decidablePred/decidableRel => DecidablePred/DecidableRel 2019-03-21 15:06:44 -07:00
Leonardo de Moura
0b5862b6ce chore(*): and => And 2019-03-21 15:06:44 -07:00
Leonardo de Moura
4c50859129 chore(*): or => Or 2019-03-21 15:06:44 -07:00
Leonardo de Moura
2be87ecd92 chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
Leonardo de Moura
f8113a01eb chore(library): unit => Unit 2019-03-21 15:06:44 -07:00
Leonardo de Moura
62e6341014 chore(*): lowercase file names 2019-03-21 15:06:44 -07:00
Leonardo de Moura
04e20623e6 chore(*): use lowercase dir names 2019-03-21 15:06:44 -07:00
Leonardo de Moura
2ea0baeb99 chore(library): use lowercase in imports 2019-03-21 15:06:44 -07:00
Leonardo de Moura
493bc63598 chore(library/init/Lean/frontend): fixed last file 2019-03-21 15:06:44 -07:00
Leonardo de Moura
8fbe31a96d chore(library/init/Lean/elaborator): fixed 2019-03-21 15:06:44 -07:00
Leonardo de Moura
855dab52e0 chore(library/init/Lean): more fixes
`elaborator.lean` is almost working
2019-03-21 15:06:44 -07:00
Leonardo de Moura
7ac847877f chore(library/init/Lean/Parser): more fixes 2019-03-21 15:06:44 -07:00
Leonardo de Moura
5bbc80fdad chore(*): fixed token.lean 2019-03-21 15:06:44 -07:00
Leonardo de Moura
f292265e4b chore(*): small fixes 2019-03-21 15:06:44 -07:00
Leonardo de Moura
5faeac3e3c chore(library/init/Lean/Parser/basic): field .FileMap => .fileMap 2019-03-21 15:06:44 -07:00
Leonardo de Moura
2ba2521caa fix(library/init/Lean/Parser/syntax): SyntaxNodeKind.Name => SyntaxNodeKind.name 2019-03-21 15:06:44 -07:00
Leonardo de Moura
ab010065f7 chore(*): setOption --> set_option 2019-03-21 15:06:44 -07:00
Leonardo de Moura
300aae08b3 chore(*): more fixes 2019-03-21 15:06:44 -07:00
Leonardo de Moura
ac27bd092b chore(*): small fixes 2019-03-21 15:06:44 -07:00
Leonardo de Moura
675003318e chore(*): small fixes 2019-03-21 15:06:44 -07:00
Leonardo de Moura
67fb78bb47 chore(*): renaming files 2019-03-21 15:06:44 -07:00
Leonardo de Moura
485abe7a10 chore(library/init/core): we can parse core.lean
@kha
2019-03-21 15:06:43 -07:00
Sebastian Ullrich
beda5f5f43 chore(library): capitalize types and namespaces 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
f7aeeaf237 exclude export/extern, translate constants.txt 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168 chore(library): switch from snake_case to camelCase 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
883ba15812 fix(library/Makefile): actually fix clean 2019-03-21 13:47:52 +01:00
Sebastian Ullrich
beae045ebc fix(CMakeLists): complete move of stage1 from src/ to build dir 2019-03-21 13:16:17 +01:00
Sebastian Ullrich
4a3cc12a13 fix(library/Makefile): clean: don't error on missing stage1/ 2019-03-20 15:45:24 +01:00
Sebastian Ullrich
ab974c1c4c chore(shell/CMakeLists,library/Makefile): store stage1 C++ output in build directory 2019-03-20 14:27:17 +01:00
Leonardo de Moura
36faa595f5 refactor(library/init): move inhabited (except ...) to except.lean 2019-03-18 16:48:58 -07:00
Leonardo de Moura
d5180ffa17 fix(library/init/lean/elaborator): make sure new frontend can parse the latest core.lean 2019-03-18 15:47:05 -07:00
Leonardo de Moura
2610ace69d feat(library/init/io): remove init_io
In the Haskell proposal for top level mutable state
https://wiki.haskell.org/Top_level_mutable_state, they describe the
following problems with using the `IO` monad during initialization.

"A more serious problem is that there is nothing to prevent arbitrary
observable IO actions from appearing to the right of the arrow. If we
perform all actions before executing main, then import becomes a
side-effectful operation, rather than simply a way of bringing names
into scope; furthermore we must specify the order in which actions from
different modules are executed, which would appear to be difficult in
general. If we execute actions on demand (as the unsafePerformIO hack
does) then we are building an unsafe syntactic construct into the
language."

I believe this is not applicable to us. First, our imports are already
side-effectful since we update attributes and the order we import
modules already matters. Second, we have already a well-defined order
in which we import modules. Finally, all global constants are already
being initialized eagerly.

Their ACIO proposal (`init_io` in our implementation) is too restrictive
for what we want to do. For example, to implement an environment
extension mechanism like we have discussed, we would also need `io.ref.write` and
`io.ref.read`. I imagine, we would have a global table, and `register`
would update this table. These extra actions do not satisfy the ACIO restrictions
described in the Haskell proposal. From their document:
"AC stands for Affine Central.
An IO action u is affine if its effect is not indirectly observable, hence need not be performed if the result is unneeded. That is, if u >> v === v for all actions v.
It is central if its effect commutes with every other IO action. That is, if do { x <- u; y <- v; w } === do { y <- v; x <- u; w } for all actions v and w."
It feels like we would have to keep fighting with the ACIO
restrictions. As I said above, our initialization order is well
defined. So, we must document the `[init]` feature and tell users they
should be aware that the `import` is important for initialization
purposes, and that their initialization actions should be
affine central whenever possible.
2019-03-18 15:33:29 -07:00
Leonardo de Moura
15d89b24a3 feat(library/compiler): [init] attribute
TODO: use attribute when emitting code in the backends.
2019-03-18 15:33:29 -07:00
Leonardo de Moura
c4e755c8d3 feat(library/init/io): add init_io and mk_global_ref 2019-03-18 15:33:29 -07:00
Sebastian Ullrich
15fe51b8bd chore(library/Makefile): make .olean and .cpp files in a single run 2019-03-18 20:25:59 +01:00