Commit Graph

39 Commits

Author SHA1 Message Date
Timothee Cour
9502e39b63 nim doc --backend:js, nim doc --doccmd:-d:foo, nim r --backend:js, --doccmd:skip + other improvements (#14278)
* `nim doc --backend:js|cpp...`
`nim doc --doccmd:'-d:foo --threads:on'`
`nim r --backend:cpp...` (implies --run --usenimcache)
* --usenimcache works with all targets
* --docCmd:skip now skips compiling snippets; 50X speedup for doc/manual.rst
2020-05-11 12:01:18 +02:00
Timothee Cour
363b7ff3b8 fix https://github.com/nim-lang/Nim/issues/14275 querySetting(nimcacheDir) works even if implicitly set (#14277) 2020-05-08 16:13:07 +02:00
Timothee Cour
b2720317fa add --experimental:vmopsDanger; add generic conversion for vmops (#13813)
* add --experimental:vmopsDanger; vmops cleanups
2020-04-20 12:00:00 +02:00
Andreas Rumpf
2b3b24a804 make bootstrapping more robust for people who have Nim inside /usr/bin (#13855) 2020-04-03 10:25:15 +02:00
Andreas Rumpf
614fb7567c std/compilesettings implementation (#13584)
* Implement compileSetting() and compileSettingSeq()
* Change from magic to vmop
* better design for querySetting

Co-authored-by: genotrance <dev@genotrance.com>
2020-03-04 13:46:42 +01:00
cooldome
a3df1b55f3 fixes #13013, reverts previous changes to readLines() (#13036) [backport]
* Revert "remove default argument for readLines (#12807) [backport]"

This reverts commit c949b81efd.
2020-01-05 09:22:41 +01:00
cooldome
c949b81efd remove default argument for readLines (#12807) [backport] 2020-01-02 23:27:37 +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
Andreas Rumpf
8a599fb571 fixes #12491 [backport] 2019-10-24 22:51:13 +02:00
Ico Doornekamp
26676066cc added cpuTime to VM (#12346)
* added cpuTime to VM

* Hide VM-time cpuTime() behind --benchmarkVM flag
2019-10-04 19:32:16 +02:00
Federico Ceratto
39290cf88c Fix spellings (#12277) [backport] 2019-09-27 07:02:54 +02:00
Andreas Rumpf
8397554315 fixes #12125 (#12131)
* fixes #12125
2019-09-06 07:23:59 +02:00
Miran
ab48d7901e hashes: implement murmur3 (#12022)
* hashes: implement murmur3
* refactoring; there is only one murmurHash and it works at compile-time via VM hooks
* fixes JS tests
* makes toOpenArrayByte work with C++
* make it bootstrap in C++ mode for 0.20
2019-09-01 00:04:10 +02:00
nc-x
d5840e1e3d Implement isExported for symbols in macros (#11963)
* Implement isExported for macros

* Reimplement isExported using VM callback mechanism

* VM does not support exceptions, use stacktrace() instead.
2019-08-18 11:51:28 +02:00
Oscar Nihlgård
50e921bb94 VM exception fixes (#11868) 2019-08-02 22:59:04 +01:00
cooldome
041d15392a Compiler plugin for implementing incremental computation in user space (#10819)
This plugin provides essential building block for implementing incremental computations in your programs. The idea behind incremental computations is that if you do the same calculation multiple times but with slightly different inputs you don't have to recompute everything from scratch. Also you don't want to adopt special algorithms either, you would like to write your code in standard from scratch manner and get incrementality for free when it is possible.

The plugin computes the digest of the proc bodies, recursively hashing all called procs as well . Such digest with the digest of the argument values gives a good "name" for the result. Terminology loosely follows paper "Incremental Computation with Names" link below. It works well if you have no side effects in your computations. If you have global state in your computations then you will need problem specific workarounds to represent global state in set of "names" . SideEffect tracking in Nim also useful in this topic.

Classical examples:

Dashboard with ticking data. New data arrives non stop and you would like to update the dashboard recomputing only changed outputs.
Excel spreadsheet where user changes one cell and you would like to recompute all cells that are affected by the change, but do not want to recompute every cell in the spreadsheet.
2019-04-11 23:09:11 +02:00
Araq
84d10f7d8a fixes #10585 2019-02-07 15:04:05 +01:00
Timothee Cour
c4e3c4ca2d add getCurrentCompilerExe to vmops (eg allows to get nim compiler at CT); add tests for vmops (#9925) 2018-12-18 09:07:12 +01:00
data-man
b0a977fe41 Don't use deprecated fmod in VM 2018-12-01 23:23:51 +05:00
Randy Smith
6c7abe6e5b Fixes #9671 (#9750) 2018-11-19 09:22:21 +01:00
Andreas Rumpf
8d850f7a69 deprecated ospaths (#9665) 2018-11-09 16:36:49 +01:00
skilchen
da178e4090 make mod on floats available in the VM (#9591)
* make `mod` on floats available in the VM
* add testcase
* removed no longer needed imports
2018-11-05 09:36:28 +01:00
Andreas Rumpf
86556ebfdb compiler refactoring; use typesafe path handing; docgen: render symbols between modules 2018-09-07 19:21:16 +02:00
Andreas Rumpf
688c54d8f1 compiler API: final cleanups; improve security by diabling 'gorge' and friends 2018-05-29 09:07:24 +02:00
Andreas Rumpf
05724645f8 more modules compile again 2018-05-12 11:58:44 +02:00
Andreas Rumpf
47335aab41 introduce nkTupleConstr AST node for unary tuple construction; breaking change 2018-04-13 17:45:58 +02:00
genotrance
c3cc52087f Added a few useful os calls to VM (#7440) 2018-04-12 13:59:14 +02:00
Andreas Rumpf
0895064983 getEnv now supports a 'default' parameter; refs #6019 2017-10-30 17:21:05 +01:00
Yuriy Glukhov
c3117e1aba Fixes #6336 (#6337) 2017-09-06 22:55:09 +02:00
Araq
9d488261df added system.gorgeEx that includes the exitCode; refs #4874; fixes #1994 2017-01-07 02:38:26 +01:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Anatoly Galiulin
807784db82 Add `readFile` implementation for nimvm 2016-04-13 16:45:22 +06:00
Araq
2aff716134 os.walkDir is available at compile time 2015-11-10 15:31:21 +01:00
Yuriy Glukhov
04a4f35400 VM produces objects. 2015-09-05 14:18:37 +03:00
Araq
0c947f31ba system.locals is now a plugin for education 2015-04-24 02:08:06 +02:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
b2f577df23 fixes #1473 2014-11-12 02:36:59 +01:00
Araq
4298553de4 system.writeFile works at compile-time 2014-10-02 10:52:32 +02:00
Araq
1f85b3b5d3 VM supports math and a few os procs 2014-08-30 16:37:27 +02:00