Commit Graph

17 Commits

Author SHA1 Message Date
Andreas Rumpf
816589b667 NIR: Nim intermediate representation (#22777)
Theoretical Benefits / Plans: 

- Typed assembler-like language.
- Allows for a CPS transformation.
- Can replace the existing C backend by a new C backend.
- Can replace the VM.
- Can do more effective "not nil" checking and static array bounds
checking.
- Can be used instead of the DFA.
- Easily translatable to LLVM.
- Reasonably easy to produce native code from.
- Tiny memory consumption. No pointers, no cry.

**In very early stages of development.**

Todo:
- [x] Map Nim types to IR types.
- [ ] Map Nim AST to IR instructions:
  - [x] Map bitsets to bitops.
  - [ ] Implement string cases.
  - [ ] Implement range and index checks.
  - [x] Implement `default(T)` builtin.
  - [x] Implement multi string concat.
- [ ] Write some analysis passes.
- [ ] Write a backend.
- [x] Integrate into the compilation pipeline.
2023-10-11 17:44:14 +02:00
ringabout
93ced31353 use strictdefs for compiler (#22365)
* wip; use strictdefs for compiler

* checkpoint

* complete the chores

* more fixes

* first phase cleanup

* Update compiler/bitsets.nim

* cleanup
2023-08-06 14:26:21 +02:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
Andreas Rumpf
9888a29c3d bitsets.nim: cleanup (#19361) 2022-01-11 10:16:51 +01:00
Clyybber
7e747d11c6 Cosmetic compiler cleanup (#12718)
* Cleanup compiler code base

* Unify add calls

* Unify len invocations

* Unify range operators

* Fix oversight

* Remove {.procvar.} pragma

* initCandidate -> newCandidate where reasonable

* Unify safeLen calls
2019-11-28 17:13:04 +01:00
Arne Döring
c7e1c665a1 [refactoring] refactor the compiler and stdlib to deprecation warnings (#11419) 2019-06-11 16:49:56 +02:00
Arne Döring
88b5dd3362 right shift is now by default sign preserving (#11322)
* right shift is now by default sign preserving
* fix hashString and semfold
* enable arithmetic shift right globally for CI
* fix typo
* remove xxx
* use oldShiftRight as flag
* apply feedback
* add changelog entry
2019-05-29 16:48:00 +02:00
narimiran
6ae74f61f3 remove trailing whitespace [ci skip] 2019-05-22 20:38:08 +02:00
Clyybber
cc28eef38e Replace countup(x, y) with x .. y 2019-05-07 12:37:28 +02:00
Oscar Nihlgård
c4d7cc3da0 Generate populationCount const at compile time (#7583) 2018-04-16 21:52:27 +02:00
Oscar Nihlgård
427490a845 Fix compile time set cardinality (#7558) 2018-04-10 10:38:16 +02:00
Adam Strzelecki
d681812465 compiler: Trim .nim files trailing whitespace
via OSX: find . -name '*.nim' -exec sed -i '' -E 's/[[:space:]]+$//' {} +
2015-09-04 23:03:22 +02:00
Araq
2781fea9e2 Nimrod renamed to Nim 2014-08-28 09:38:14 +02:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
cd292568d7 big repo cleanup 2011-04-12 01:13:42 +02:00