Releases: jd-develop/nougaro
1.2.0
A new Nougaro version is out, including two new sorting algorithms and crashfixes!
Added
- Added two modes to the
sort
built-in function:slow
andslow-verbose
. Both are slowsort implementations, the former is silent and the latter prints how much elements are already sorted. - Added one other mode to the
sort
built-in function:bogo
. It is a bogosort implementation. - Added
math.gcd
, that takes exactly two integer arguments and return their gcd.
Changed
- Any value can now be passed as
assert
error message (and will be converted to str) $
and the following identifier can now be spaced ($ id
is now valid)paraghraphs
argument of functionlorem.ipsum
is now optional and defaults to 1- Version ID has been increased to
11
.
Fixed
- Fixed a crash in
math.log
on base=1 - Fixed crashes in
math.log2
(I forgot to update this function when fixing the same crashes in 0.18.0-beta) - Fixed a crash on
int(float("nan"))
andint(float("inf"))
. - Fixed a bug where identifiers after
$
could start with digits - Optimised asserts a little bit
- Better error messages
- Stalinsort no longer sorts the list in-place (it returns a “““sorted””” copy of the list instead of “““sorting””” the original list)
- Miraclesort and panicsort now also return a copy of the original list (if they return something…)
- Updated error messages when method in not defined in python-written modules (does not change anything to public API)
Build scripts
- Build scripts now copy
CHANGELOG.md
. build.bat
is now more verbose.
Calculator
Fixed
- Fixed a crash with
log
on base=1
1.1.0
Added
- Added the
loop
loop, which is an infinite loop. - Add support for newlines after
(
and[
, before)
and]
, as well as inside lists, calls, and function defs, and after commas.
For instance, this is now legal:def a( b, c )( d = 4, e = 5 ) stuff end
Changed
- Version id has been increased to
10
Calculator
Added
- Added the
sto
instruction, that stores the last value in the stack into the memory. - Added the
gsto
variable, which is the value contained in the memory.
Changed
- The
p
instruction can be used in any command (e.g. things like1 2 + p
are now possible)
1.0.0
This version defines public API.
Changes since 1.0.0-rc.2
As this change does not affect public API, this is released as 1.0.0
Fixed
(Build scripts)
(Windows) The build script now properly removes__pycache__
.
1.0.0 release candidate 2 (1.0.0-rc.2)
If no other bug is found, this is what will be released as 1.0.0.
Fixed
- Maybe fixed some encoding bugs (for instance with imports) under Windows
Full code changes: 1.0.0-rc.1...1.0.0-rc.2
1.0.0 release candidate 1 (1.0.0-rc.1)
Changed
- Version id has been increased to
9
.
Fixed
- Fixed attribute error messages (previously,
(1).b
was giving the messageAttributeError: attribute of 1 has no attribute 'b'.
, which was erroneous)
Full code changes: 0.23.0-beta...1.0.0-rc.1
Beta 0.23.0 [YANKED]
These release fixes some bugs in the build script for Windows that were introduce in 0.22.0-beta.
Added
- Added
noug_version.clean_version_for_nuitka_under_windows()
function, that returns a nice output of the Nougaro version that can be passed into the--windows-product-version
Nuitka argument. Takes 2 optional parameters:print_value
(default=False), which, if true, makes the function prints the result; andreturn_value
(default=True), which, if true, makes the function returns the result. - Added two new optional parameters to the
noug_version.clean_version_for_gh()
function:print_value
(default=False), which, if true, makes the function prints the result; andreturn_value
(default=True), which, if true, makes the function returns the result.
Changed
- Version ID has been increased to
8
.
Fixed
(Build scipts)
(Windows) Fix Nuitka crashing when called
Full code changes: 0.22.0-beta...0.23.0-beta
Beta 0.22.0
This version comes with a new huge functionality – optional parameters –, rather big bug fixes, as well as smaller tweaks and fixes.
This version also comes with a brand new documentation.
Added
- Added optional parameters to function definitions. Use
def identifier(mendatory1, mendatory2)(optional1=default_value, optional2=default_value)
to define optional parameters. When you call the function, you can omit the optional arguments. If you want to leaveoptional1
to its default value but to changeoptional2
, you can useidentifier(mendatory1, mendatory2, <default>, new_value)
. - Added the
<default>
token, and the<default>
value. - Added a new type of comments (NOUGAROIGNORE). They are opened and closed by
..NOUGAROIGNORE
or.. NOUGAROIGNORE
where.
is any character among#@/%!$;
. There should not be anything else on lines where there are NOUGAROIGNORE opening or closing statements.
Changed
- Version ID has been increased to
7
. - Lib version has been increased to
4
. - Key
"run_noug_dir_work_dir"
in BuiltinFunction dictionaries (and in libs too) was renamed to"run_noug_dir"
. - Type of functions is now
func
, regardless of if they are functions or built-in functions. However, type of methods is stillmethod
. - Modules and functions are now True in boolean context (i.e. in a condition)
round
built-in function now returnsint
ifn_digits
⩽ 0, not only forn_digits
= 0.__how_many_lines_of_code__
now accepts any value as argument (it checks if the value is true).(Internal API)
dived_by
andfloor_dived_by
methods in Values are now renamed todivided_by
andfloor_divided_by
.(Build scripts)
(Windows) The Nougaro version is now automatically fetched.
Removed
(Internal API)
to_str_
,to_int_
,to_float_
,to_list_
methods in Values are now removed. Please useto_str
,to_int
,to_float
andto_list
instead.
Fixed
- Fixed position start and end of duplicate arguments error messages.
__test__
andexample
builtin functions now work from every location in the filesystem.- Fixed functions returning
None
if their return value was interpreted asFalse
(empty string, empty list, …) - Fix a potential crash with errors (when an error occurs in an empty line…)
Beta 0.21.0
This version is small but contains a rather big crash fix, as well as a deprecation.
Changed
- Data version has been increased to
7
. - Lib version has been increased to
3
. - Version ID has been increased to
6
. - Data in the config files can now be typed, meaning that only a certain type of data can be written.
- Under GNU/Linux and Unix, panicsort (
sort(list, "panic")
) now crashes withillegal hardware instruction
instead ofsegmentation fault
when the list is not sorted (funnier). Thanks @Mistera91! (Internal API)
Changedto_str_
,to_int_
,to_float_
,to_list_
methods toto_str
,to_int
,to_float
andto_list
in Values. The old name are now deprecated and will be removed in 0.22.0 (or will be removed in 1.0.0-rc.1 if it releases before 0.22.0)
Deprecated
(Internal API)
to_str_
,to_int_
,to_float_
,to_list_
methods in Values are now deprecated and will be removed in 0.22.0. Please useto_str
,to_int
,to_float
andto_list
instead.
Removed
(Internal API/Writing libs)
RemovedTRUE
,FALSE
andNULL
values, please useNumber(True)
,Number(False)
andNumber(0)
instead.
Fixed
- Fixed a crash when giving too many arguments to a function having the property
should_respect_args_number
set toFalse
. - Fixed a bug with
position_end
of call nodes (it was just before the closing parenthese)
Beta 0.20.0
This version may in some cases improve performance.
Added
Syntax
- Allow the
+
sign in a e-infix expression (such as10e+3
)
Flow control
- Add the
break and return (value)
syntax, which allows to return a certain value when breaking a loop. - Add loop labels:
- Using the syntax
for:label
,while:label
ordo:label
, you can label your loops. - Using the syntax
break:label
andcontinue:label
, you can break or continue an outer loop.
- Using the syntax
Builtins
- Add the
is_object
builtin function - Add the
is_constructor
builtin function
Metas
- Add the
appendNoneOnContinue
meta- Takes no argument
- If enabled, loops will append
None
to their result if there is acontinue
(see the Changed section)
- Add the
appendNoneOnBreak
meta- Takes no argument
- If enabled, loops will append
None
to their result if there is abreak
(see the Changed section)
Command line interface
- Add the
-i
(or--interactive
) CLI argument. Allows to run an interactive shell after executing
a file, within the context of that file (i.e. with all the variables)
Technical and debug
- Add the
print_time
debug option: adddebug.should_print_time
(0 or 1),debug.print_time()
,debug.stop_print_time()
. This option prints the total time different parts of Nougaro took to complete. [Internal API]
AddRecursionError
, accessible in libs usingRTRecursionError
.[Internal API]
Add Library Version, accessible throughsrc.noug_version.LIB_VERSION
. It is stored in the key"lib-version"
innoug_version.json
. It is currently2
.
Changed
Syntax
- Numbers can no longer have trailing underscore at the beginning or at the end.
Runtime
- Loops no longer append
None
to their result if there is acontinue
orbreak
. UseappendNoneOnContinue
andappendNoneOnBreak
metas if you still want to do that. - Rework completely equality and other comparisons to be more consistant
- Functions, built-in functions, methods and module functions can now be equal (if they’re the same)
- Same for objects and constructors
- Strings can now be less than or equal to others, according to the alphabetical order.
For instance,"foo" > "bar"
, and"hello" < "world"
. <
,<=
,>
,>=
comparisons now crash when used on lists, modules, constructors, objects, any function, None.and
,or
andxor
now works properly with functions, methods, built-in functions
- Functions can now be converted to strings using
str()
. - Representation of the
exit
builtin function is now"Use exit(), CTRL+C (i.e. interrupt) or CTRL+D (i.e. EOF) to exit."
instead of"<built-in function exit>"
.
Technical and debug
debug.enable_all()
anddebug.disable_all()
now also enable or disable theprint_time
debug option.- Data version has been increased to
6
. - Version ID has been increased to
5
. [Internal API]
It is now possible to compare Nodes and Tokens. Usenode1 == node2
ornode1 != node2
. Does not checkpos_start
andpos_end
, so it is better thanhash(node1) == hash(node2)
.[Build scripts]
(Linux) The Nougaro version is now automatically fetched.
Writing libraries
- Modules written in Python now need to have a library version (
__LIBRARY_VERSION__
). If a module doesn’t have the same
library version as the current Nougaro version, an error is thrown. Library version is currently2
. - Libraries now need the
is_eq
method as described in documentation (TODO: update doc on release – the method is described but in a “in the future you will have to” box).
Removed
- Removed
noug_version.phase_minor
. Usenoug_version.release_serial
instead.
Fixed
- Fix position start of constructors in error messages.
10eanystringofcharacters-10
is no longer parsed to10e-10
, and throws an error instead.- Fix a crash on maximum recursion depth exceeded.
- Fix a bug where you could have two parameters with the same name in a function definition.
- Start and end positions of
xor
are now correct. - Accessing a variable no longer return a copy of the value, but directly the value instead. It allows things such as
def return(object)->object; var return(a).b = 4
(this previously lefta.b
unchanged, it now properly updates it to 4) input_num
now returns an integer if the entered value is an integer, otherwise it returns a float.- Fix a crash when trying to print surrogates unicode characters (within a pair or not)
Beta 0.19.0
Changelog
This version comes with a lot of new features, and one single deprecation (see “How to update” to know how to update your code). This version improves a little bit performances in some cases.
Added
Libs
- Add the
noug_version.clean_version_for_gh
function that generates a beautiful str for the GH issues or PRs. - Add
noug_version.release_serial
which is the same asnoug_version.phase_minor
, as it is now deprecated. - Add
math.factorial
, which computes factorial. - Add
webbrowser
lib, which contains one function:webbrowser.open(url, new=0, autoraise=True)
: displayurl
using the default browser.
Ifnew
is 0, theurl
is opened in the same browser window if possible.
Ifnew
is 1, a new browser window is opened if possible.
Ifnew
is 2, a new tab is opened if possible.
Ifautoraise
is True, the window is raised if possible (note that under many window managers this will occur regardless of the setting of this variable).
Metas
- Add a “meta” system
- Using the syntax
@meta metaName
or@meta metaName metaValue
at the beginnig of a file, you can now enable special features - As predicate, you can use
@
,#@
,%@
,@@
,-@
or$@
.
- Using the syntax
- Add
legacyAbs
meta- No value required
- It makes the legacy absolute value possible:
|-1|
=1
- However, it makes bitwise or not accessible.
- Add
nbspBetweenFrenchGuillemets
meta- No value required
- Experience the true french pain! (and I don’t talk about baguettes…) If you want to use the french string quotes (
«»
), you will have to put a no-break space (or a narrow no-break space) after the«
and before the other»
. Those (N)NBSP will not be counted in the string.
- Add
setTheTestValueTo
meta- Sets
__the_test_value__
to the str value given in the meta value - If no value is given, it sets it to
None
.
- Sets
Technical
- Data version and version ID can now be known using
__data_version__
and__version_id__
. - Data version is now stored in
./noug_version.json
(lib to make libs)
Adddefault_pos
function, which returns a tuple (Position, Position)(Internal API)
Noug version can now be retrieved usingsrc.noug_version
library. It consists of 8 constants:MAJOR
,MINOR
,PATCH
,PHASE
,RELEASE_SERIAL
,VERSION
(str
),VERSION_ID
,DATA_VERSION
. It does not contains “phase minor”, as it is now called “release serial”.(Build scripts)
It is now possible to use a custom python command inbuild.sh
by passing the command as parameter. Note that I forgot to mention that this is possible withrun_tests.sh
since 0.18.0-beta.
Changed
- Renamed “phase minor” to “release serial”. In
noug_version.json
, the key is renamed fromphase-minor
torelease-serial
. The different “phase minor” references are now deprecated (see the Deprecated section), and will be removed in 0.20.0
Technical
- Moved
./config/noug_version.json
to./noug_version.json
- Data version has been increased to 5
- Version ID has been increased to 4
- Argument handling has been rewritten back without
argparse
, it was causing more issues than it simplified things - Renamed the
--command_dont_verbose
CLI option to--command-dont-verbose
. - Each value now takes
pos_start
andpos_end
arguments, so watch out if you’re making libs! These changes will be available in the documentation (along with everything else)
Deprecated
noug_version.phase_minor
is deprecated and will be deleted in 0.20.0.
Fixed
- Fix typos
- Fix a bug where files were referred as
<stdin>
in the shell (and therefore in error messages, etc.) - Fix some crashes with imports (where values didn’t have any context)
- Fix an internal bug where the first optional argument of functions whose
should_respect_args_number
wasFalse
was not populated. Never happen in real life because no such function take optional arguments, but you know, just in case. - Unit tests now work properly when debug mode is enabled
- Fix the fact that Nougaro exited with exit code 0 even when there was an error using
-c
,-d
, etc. - Sometimes, tracebacks in error messages indicated file
(unknown)
and line(unknown)
: this has been fixed
Calculator
Added
- Add the possibility to print the current value (last value in stack) using
p
. - Add the possibility to exit with
exit()
(yes, it was frustrating) - Add a “DC mode”, accessible using
-d
or--dc-mode
option, which is a minimal, teletype-friendly mode. - Add the possibility to print the help message using
-h
CLI option. - Add the possibility to print the last error message with
h
. - Add factorial with
number !
.
Removed
- Remove the possibility to print i with
pi
(it is now possible to get the value of π outside of an operation) - Remove the possibility to print the help with
h
Fixed
- Adding more dots into a float no longer does the same thing as adding multiple floats (for instance,
1.9.12
was previously parsed to2.02
, which is the same as1 0.9 + 0.12 +
)
How to update
Important
If you were using noug_version.phase_minor
, simply replace it with noug_version.release_serial
, as phase_minor
is now deprecated.
Full Code Changes: 0.18.0-beta...0.19.0-beta