Page 3 of 3

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers and more

Posted: Sun Jun 05, 2022 4:43 pm
by jack
thabk you :)

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers and more

Posted: Sun Aug 28, 2022 1:53 pm
by STARGÅTE
Dear all,

after the bug-fix update from the last time, now I want to share a new feature update.
________________________________________
Lizard - Symbolic computation script language (Version 0.4.4-0002)
Contains the Lizard.dll (Windows x64 and x86), the Lizard.so (Linux x64), the Lizard.pbi, some examples for the integration in Pure Basic and a detailed documentation for Lizard with many examples.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
The new feature gives you the opportunity to run calculations on multiple cores at the same time, which is the first step towards "parallel computing".
Following my principle of handling everything very easy in Lizard, there will be a simply "parallel" version for a few commands, which automatically creates a thread pool, distributes the calculations there, collects the normal results and returns it, without the user having to worry about anything.

An example:
While "Iterate(f(x), {x, 1, 1000})" executes a time-consuming function f sequentially on only one core, "IterateParallel(f(x), {x, 1, 1000})" distributs this calculation automatically on many cores (threads). Depending on the ratio of the actual calculation time to the time required for the thread management stuff, the overall execution time is usually significantly faster. Of course, this does not fit to simple functions, where parallelization is a disadvantage.

An overview of the new parallel computing functions with examples can be found here:Lizard » Core Language » Parallel Computing
Please keep in mind that you can put any Lizard function into a e.g. parallel iteration, to spread them to multiple cores.

Besides, there are a few other new functions like reciprocal trigonometric and hyperbolic functions, some other mathematical functions, again a few bug fixes and I put function plots for numerical functions in the documentation. Lizard » History

So, have fun while testing these features and I will appreciate your feedback.

Edit: Hot-fix 0.4.4-0002

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Sun Aug 28, 2022 3:59 pm
by jack
Hello STARGÅTE :)
if I run my FreeBasic example here's what I get, if I repeatedly enter the expression IterateParallel(f(x), {x, 1, 10000})

Code: Select all

-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  0.8843369000005623 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  0.8588957000010851 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  0.8535100999997667 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  0.8651286999993317 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  0.8615126999993663 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  1.376355700000204 seconds
-> IterateParallel(f(x), {x, 1, 10000})
elapsed time  15.84586130000025 seconds

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Sun Aug 28, 2022 4:33 pm
by STARGÅTE
Dear Jack,

I assume, you haven't define a function for f? So accually, you just create a large expression like:
"{f(1), f(2), f(3), f(4), ..., f(9999), f(10000)}" without any evaluation.
This means, no parallization is possible.

Let's try the following. Here, a function f is a function which needs ~10ms for evaluation:

Code: Select all

In(1)   :=  f(x?) := Pause(0.01)
                                                    evaluation time:    0.067ms
In(2)   :=  Iterate(f(x), {x, 1, 100});
                                                    evaluation time: 1058.806ms
In(3)   :=  IterateParallel(f(x), {x, 1, 100});
                                                    evaluation time:  144.861ms
Regarding the increase of time: You should use Lizard_FreeExpression(Expression) after you output them to release the memory. Otherwise, all expressions keep in memory.
However, I'm wondering, why the evaluation time increases at a certain evaluation rapidly.
I can confirm such behavior, when I print the all the results. It has nothing to do with the parallel computing. I have to check.

Edit: I have found the issue. The String-Return from the DLL was "wrong".
Lizard - Symbolic computation script language (Version 0.4.4-0002)

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Mon Oct 21, 2024 10:04 pm
by Al_the_dutch
Hi STARGÅTE,

First let me thank you so much, this is great. I am using your script language and it is amazing fast and very useful.
But I have some questions.I hope you or other users can help me out.

Code: Select all

XIncludeFile "../Lizard/Library/Lizard.pbi"

; Lizard always has to be initialized first.
If Lizard::Initialize("../Lizard/Library")  ;  Define here the path of the Lizard.dll location.
	Debug "Lizard kernel has been initialized. Version "+Lizard::Version()
Else
	Debug "Lizard kernel initialization failed!"
	End
EndIf

Define In$, Out$, Dec$

;EX1
In$ = "Calculate(3 * 479207)"
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; => 1.43762e6 ; did not ask for this scientific notation

;EX2
In$ = "ToInteger(Calculate(3 * 479207))"
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; ==>  1437621 ; ok

;EX3
In$ = "ToInteger(Calculate(3 * 4657387907292887))" 
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; => 13972163721878660; wrong, should be 13972163721878661

;EX4
In$ = "ToInteger(Calculate(3 * 4657387907292887, 20))" 
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; => ok

;EX5
In$ = "ToInteger(Calculate(3 * 6825132555633339069956470743970633775870071, 20))" 
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; 20475397666900017209869403903378106225786880 => wrong so 20 is Not enough For long integer-strings

;EX6
Out$ = "6825132555633339069956470743970633775870071"
Dec$ = Str(Len(Out$))
In$ = "ToInteger(Calculate(3 * " + Out$ + ", " + Dec$ + "))" 
Out$ = Lizard::Evaluate(In$)
Debug Out$ ; => ok

; Details
; Integer numbers can be of any size And are Not limited To the word size of the processor.
; Integer numbers are always exact values.

;Questions:
;1. Where is the documentation of Evaluate()? I did not find it.
;2. How can I force output to be string format like in EX2.
;3. What am I doing wrong in EX3?
;4. Is Ex6 the way to go? Can I make it better/faster?
;5. Integer numbers are always exact values says the documentation, is this correct or am I doing something wrong?

KR Al

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Tue Jul 08, 2025 1:05 pm
by STARGÅTE
Al_the_dutch wrote: Mon Oct 21, 2024 10:04 pm Hi STARGÅTE,

First let me thank you so much, this is great. I am using your script language and it is amazing fast and very useful.
But I have some questions.I hope you or other users can help me out.

Questions:
1. Where is the documentation of Evaluate()? I did not find it.
2. How can I force output to be string format like in EX2.
3. What am I doing wrong in EX3?
4. Is Ex6 the way to go? Can I make it better/faster?
5. Integer numbers are always exact values says the documentation, is this correct or am I doing something wrong?

KR Al
Dear Al_the_dutch,
I'm so sorry that I missed your post last year, I didn't noticed it and then it was out of the active threads.
Now, I saw it and I hope you are still interested in using the script.
So I will try to answer your questions:

>> "1. Where is the documentation of Evaluate()? I did not find it."
Lizard::Evaluate() is a function from the Include file. It just evaluates the input string by the script language and outputs a string again.

>> "2. How can I force output to be string format like in EX2."
The Lizard function "Calculate" force a calculation to floating point numbers and returning scientific notation.
When you try to evaluate 2*Pi, the output will be just 2*Pi, because Pi is a constant. Calculate(2*Pi) forces the calculation and give 6.28319, like you get when you evaluate 2.0*Pi.
In general there is no need for using Calculate(). Lizard::Evaluate("3 * 479207") will also return 1437621.

>> "3. What am I doing wrong in EX3?"
Calculate() performs by default a (fast) calculation with double precision (roughly 16 decimal digits). Your number 3*4657387907292887 has more digits. So either you just write Lizard::Evaluate("3 * 4657387907292887") to perform exact integer calculation, or you force the number of decimal digits to be used, like you did in EX4.

>> "4. Is Ex6 the way to go? Can I make it better/faster?"
No. Simply use Lizard::Evaluate("3 * 6825132555633339069956470743970633775870071").

>> "5. Integer numbers are always exact values says the documentation, is this correct or am I doing something wrong?"
Yes that's true, as long as you don't mix them up with decimal numbers.

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Tue Jul 08, 2025 2:37 pm
by Al_the_dutch
Thank you :!: :D

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Wed Feb 11, 2026 11:03 am
by dmontaine
Hi, what is the license for Lizard. I am not able to use code or tools without knowing the license. Thanks.

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Wed Feb 11, 2026 1:57 pm
by STARGÅTE
dmontaine wrote: Wed Feb 11, 2026 11:03 am Hi, what is the license for Lizard. I am not able to use code or tools without knowing the license. Thanks.
Dear dmontaine, that is indeed a very important question. Since Lizard is still in a very early stage of development, I hadn't thought about that before.
I think, GNU LGPL would be a perfectly matching license for this. However, since I haven't yet published the source code of the DLL itself, it is not possible to distribute Lizard under the GNU LGPL licence, right?

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Wed Feb 11, 2026 11:27 pm
by dmontaine
Without source code I believe you are correct. You could use one of the Creative Commons licenses (https://www.creativecommons.org). There are six different licenses, with the CC-BY license possibly being the most permissive. If you want an even more permissive license, you might try this (https://www.https://blueoakcouncil.org/license/1.0.0). Also, you might try a modified BSD 0 clause license as follows:

--------------------

Copyright (C) [year] by [copyright holder] <[email]>

[ Possible addition: "This software is distributed only in binary form. No source code is available". ]

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

-----------------------

The binaries likely could not be used in open source projects as they would not be compatible with the requirement that source code be available. However, they probably could be used in conjunction with Freeware (free software distributed without source code) or Commercial software.

Note: I am not a lawyer. This is only based on my research of available licenses and is not a legal opinion or recommendation.

Re: Lizard - Script language for symbolic calculations, arbitrary large and precise numbers, parallel computing and more

Posted: Thu Feb 19, 2026 9:06 pm
by STARGÅTE
I've thought about the different licensing models and haven't come up with a solution yet.

The Creative Commons licenses are usually not used in combination with programming and software.
Accordingly, they are sometimes in conflict with other licensing models, e.g., GNU.
I already had this discussion in another thread, and it caused a lot of trouble.

As I haven't published the source of the DLL up to now, I have to search for a non-open-source licence, which, however, can be later weaken to an open-source licence when I make the source public. (I think this direction is possible, but not the other way around)

So when I now licence the Lizard.dll under MIT licence (which is to my understanding also possible without making the source open source), however, I cannot change it later to GNU LGPL because it is more protective even if the source code is then public.

I understand that the current situation (no license) is hindering the use, so I try to find a solution.