Commit Graph

1027 Commits

Author SHA1 Message Date
Timothee Cour
e07d661d16 fix #14475; unittest.require now works with nim c; require and check now works with -d:nodejs (#14676)
* fix #14475; make unittest work with -d:nodejs

* fixup

* fixup

* disable inim, delaunay which failed after unittest.require got fixed

* re-enable tests that have been fixed
2020-07-14 13:14:32 +02:00
Andreas Rumpf
da29222f86 init checks and 'out' parameters (#14521)
* I don't care about observable stores
* enforce explicit initializations
* cleaner code for the stdlib
* stdlib: use explicit initializations
* make tests green
* algorithm.nim: set result explicitly
* remove out parameters and bring the PR into a mergable state
* updated the changelog
2020-06-23 10:53:57 +02:00
Timothee Cour
dfe51d10a1 addQuitProc now works with closures, and c, js(node/browser) backend; fix some bugs in testament (#14342)
* make addQuitProc great again

* fix bugs in testament

* fix test

* change 2016 => 2020

* addQuitProc => addExitProc + locks

* move to std/exitprocs
2020-06-16 11:43:48 +02:00
Timothee Cour
3d20f14193 fix #10731 ; runnableExamples "-b:cpp --run:off": code works (#14384)
* runnableExamples "-b:cpp -r:off": code
2020-05-20 09:45:34 +02:00
Kaushal Modi
bf0e1c696f Remove the uses of {.procvar.} pragma (#14359)
This pragma did nothing.

Ref:
- https://github.com/nim-lang/Nim/issues/2172#issuecomment-383276469
- https://github.com/nim-lang/Nim/issues/12975
2020-05-15 23:37:24 +02:00
PMunch
13cfaf5fd5 Improve nimeval, changes some defaults (#14351)
* Improve nimeval, changes some defaults

This improves nimeval to make it easier to use NimScript as an embedded
scripting languages. It does change some of the defaults, so in case
anything used the old version and depended on the old behaviour these
would have to be changed.

* Remove dependency on nimhcr for nimscript
2020-05-15 19:32:52 +02:00
Timothee Cour
041ee92bba osproc.execCmdEx now takes an optional input for stdin, env, workingDir (#14211)
* `osproc.execCmdEx` now takes an optional `input` for stdin

* execCmdEx now also takes an optional ``workingDir` and `env`
2020-05-13 13:45:36 +02:00
Andreas Rumpf
06dfd31612 fixes #13881
* fixes #13881
* documented changed requirements for system.onThreadDestruction
* destructors.rst: update the documentation
2020-05-12 15:46:24 +02:00
Timothee Cour
411be506a3 --hint:processing (+friends) is now supported and means --hint:processing:on, like all other bool flags (#14271) 2020-05-08 18:54:16 +02:00
hlaaftana
6b7b5fb4fa Clarify JS cstring len (#14184) 2020-05-05 10:34:37 +02:00
cooldome
eefada8a88 fix #14217 (#14218)
* fix #14217

Co-authored-by: cooldome <ariabushenko@bk.ru>
2020-05-05 07:26:32 +02:00
hlaaftana
fbc97e712a move since from inclrtl to std/private/since (#14188)
* move since from inclrtl to std/private/since
* move since import in system below for HCR
2020-05-02 23:51:59 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
Timothee Cour
a3a317b76d $ now works for unsigned intergers with nim js (#14122)
* $(unsigned) now works for js
* move NimMajor+friends closer to NimVersion according as per reviewer feedback
2020-04-27 19:15:17 +02:00
Timothee Cour
9384f7ad35 since now takes an optional patch, eg: since: (1, 3, 1) (#14124)
add tests for tinclrtl
2020-04-26 14:55:25 +02:00
Arne Döring
4005f0d0e4 forward type alignment information to seqs (#12430) 2020-04-19 07:52:01 +02:00
narimiran
ed44e524b0 bump devel version to 1.3.1 2020-04-03 21:28:11 +02:00
Timothee Cour
19cab9fa51 stacktraces can now show custom runtime msgs per frame (#13351)
* stacktraces can now show custom runtime msgs
* improve tests/stdlib/tstackframes.nim
* fix test for --gc:arc
* test --stacktraceMsgs:on and --stacktraceMsgs:off
* --stacktracemsgs:off by default
2020-03-30 13:45:32 +02:00
Andreas Rumpf
fb641483f0 arc optimizations (#13325)
* scope based destructors
* handle 'or' and 'and' expressions properly, see the new test arc/tcontrolflow.nim
* make this branch mergable, logic is disabled for now
2020-03-18 16:57:34 +01:00
Andreas Rumpf
a6682de004 catchable defects (#13626)
* allow defects to be caught even for --exceptions:goto (WIP)
* implemented the new --panics:on|off switch; refs https://github.com/nim-lang/RFCs/issues/180
* new implementation for integer overflow checking
* produce a warning if a user-defined exception type inherits from Exception directly
* applied Timothee's suggestions; improved the documentation and replace the term 'checked runtime check' by 'panic'
* fixes #13627
* don't inherit from Exception directly
2020-03-12 23:44:33 +01:00
Miran
14b2354b7d rename lenTuple and lenVarargs (#13639)
* rename 'lenTuple' to 'tupleLen'

Rationale:
`lenTuple` is a tuple consisting of lengths (e.g. `(1, 5, 0)`),
`tupleLen` is a length of a tuple (e.g. `tupleLen((1, 5, 0) == 3`)

* rename 'lenVarargs' to 'varargsLen'

The same rationale as a previous commit. Consistency.
2020-03-12 20:07:02 +01:00
Timothee Cour
6a0e87eb38 cleanup Ordinal (#13501) 2020-02-27 10:43:13 +01:00
Juan Carlos
94b0d6bb63 Documentation staticRead maximum file size limits (#13485) 2020-02-26 10:01:23 +01:00
cooldome
046bb0b881 stdlib/system: add sink and move (#13283) 2020-02-18 19:43:26 +01:00
cooldome
76ede7c198 Repr v2 progress (#13268)
* progress on repr_v2

* repr progress

* add ref objects with distrinct

* fix failing tests
2020-01-28 20:05:57 +01:00
D-Nice
f12bea16ad [backport] fix #11440, add docs to isNil for seq types needing nilseq (#13234) [ci skip] 2020-01-23 07:51:53 +01:00
Miran
352232e62d style fix: change 'JS' to 'js' to make it consistent (#13168) 2020-01-16 14:14:03 +01:00
Miran
e708d5de75 System cleanup, part 2 (#13155)
* create basic_types, arithmetics, exceptions, comparisons
* create setops.nim
* create memalloc.nim
* create gc_interface.nim
* create iterators_1.nim
2020-01-15 14:42:49 +01:00
Ico Doornekamp
79a326759a Added 'ansic' os support for minimal (embedded) targets (#13088)
* os:any implementation
* os:asny: omit flock/funlock calls in echoBinSafe
* Disabled default "unhandled expection" reporting for `--os:any` to reduce
code size. Added unhandledExceptionHook instead which can be used to get
a notification from Nim and handle it from the application.
2020-01-15 11:06:41 +01:00
Andreas Rumpf
767592a3c3 more arc features (#13098)
* config update
* ARC now supports 'repr' and 'new' with finalizers is supported
2020-01-10 23:17:33 +01:00
Miran
f7ce4e8705 System cleanup, part 1 (#13069)
* system.nim: mark what every .pop does

* system.nim: un-nest when statements
2020-01-10 10:14:02 +01:00
Andreas Rumpf
c3344862b0 --exception:goto switch for deterministic exception handling (#12977)
This implements "deterministic" exception handling for Nim based on goto instead of setjmp. This means raising an exception is much cheaper than in C++'s table based implementations. Supports hard realtime systems. Default for --gc:arc and the C target because it's generally a good idea and arc is all about deterministic behavior.

Note: This implies that fatal runtime traps are not catchable anymore! This needs to be documented.
2020-01-01 10:01:49 +01:00
Araq
5aa7b1a44b ARC: default to a shared heap with --threads:on 2019-12-24 17:33:27 +01:00
Araq
9faf00598f ported channels to ARC 2019-12-24 17:33:27 +01:00
Timothee Cour
a0980c88c9 lenVarargs: number of varargs elements (#12907) 2019-12-23 09:42:32 +01:00
Judd
e1d79d40f2 update documentation for closureScope and capture (#12886) 2019-12-21 08:06:32 +01:00
Clyybber
10bd7d8fa0 system.reset is no longer magic (#12937)
It has now means setting x to default for new and old runtime alike
2019-12-19 20:36:59 +01:00
Andreas Rumpf
83a736a34a ARC: cycle detector (#12823)
* first implementation of the =trace and =dispose hooks for the cycle collector
* a cycle collector for ARC: progress
* manual: the .acyclic pragma is a thing once again
* gcbench: adaptations for --gc:arc
* enable valgrind tests for the strutils tests
* testament: better valgrind support
* ARC refactoring: growable jumpstacks
* ARC cycle detector: non-recursive algorithm
* moved and renamed core/ files back to system/
* refactoring: --gc:arc vs --gc:orc since 'orc' is even more experimental and we want to ship --gc:arc soonish
2019-12-17 17:37:50 +01:00
Andreas Rumpf
3fbb3bfd3f ARC related bugfixes and refactorings (#12781) 2019-12-05 16:59:06 +01:00
itsumura-h
208b018f6b fix db_mysql getRow() when column is null error raised (#12806) [backport]
* fix db_mysql getRow()
* added if y == nil [backport]
2019-12-05 10:28:47 +01:00
Euan
c5c6bae2a4 #12103 - CI for FreeBSD (#12179)
* Ref #12103 - adds FreeBSD CI
* Fix getApplFreebsd - length of the string includes the null terminator byte, so minus 1 for result length
* Show last commit in setup task.
* Remove .git from repository URL
* Don't include noisy details showing last commit.
* Add FreeBSD build status badge
* Fix #12182 - disable tconsole on FreeBSD
* Disable tgetaddrinfo on FreebSD as getaddrinfo doesn't support the ICMP protocol.
* Install boehm-gc-threaded
* Use libgc-threaded.so on FreeBSD rather than libgc.so.
* Simplify build failure handling. Update alt text for CI badge.
* Disable test on FreeBSD
* Simplify build config

- use GNU make to build csources
- set PATH variable using the environment key
- remove modification of config to set CC as this is already set

* Install git which seems to be missing from current freebsd images
* Revert change to how path is set
* Add a comment explaining why the length is truncated
* Fix tconsole.
2019-11-29 21:00:54 +01:00
Jasper Jenkins
9ea55eccbb make addQuoted work on nimscript (#12717) [backport] 2019-11-28 23:01:17 +01:00
Araq
72237e2bcf ARC: ported the GC tests over to --gc:arc 2019-11-26 16:04:28 +01:00
Araq
25c724d38b gc:arc: support GC_ref/unref for ref T 2019-11-13 23:29:21 +01:00
cooldome
1e71c13697 fix compilation warning (#12618)
* fix compilation warning

* comments incorporated
2019-11-08 09:16:44 +01:00
Andreas Rumpf
3ba3307d61 remove deprecated procs (#12535) 2019-11-05 11:05:46 +01:00
narimiran
bdc2bcc36c NimPatch of devel version should be an odd number because of the earlier hacks 2019-11-03 16:04:21 +01:00
Kaushal Modi
d914e9a65f [backport] Add docs to better distinguish among getProjectPath, getCurrentDir and currentSourcePath (#12565)
Fixes https://github.com/nim-lang/Nim/issues/10477.
2019-10-31 21:00:18 +01:00
Arne Döring
99078d80d7 introduce csize_t instead of fixing csize (#12497) 2019-10-31 19:18:12 +01:00
Andreas Rumpf
1746da2d9e --gc:destructors now means Nim uses pure refcounting (#12557) 2019-10-30 16:15:17 +01:00