Lua Patterns Viewer and Lua Infographics announcement

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Lua Patterns Viewer and Lua Infographics announcement

Spar
Hello, Lua.
I want to share some of my stuff I made for Lua that might be helpful or interesting to someone here.

1. Lua Patterns Viewer
A tool to analyze, inspect and learn patterns.
The tool has just started working, any help is welcome.

2. Lua Infographics
A collection of charts and infographics about Lua such as:
- Lua libraries names, dependencies and pureness.
- Lua activity and popularity.
- Lua speed benchmarks (From 1.0 to 5.4.1).
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Andrea-2
'$' at the end of the pattern should anchor to end of string

but if one follows the link the example indicates that '&' at the end of the pattern anchors to end of string

if one overwrites the example by typing a single '$' as pattern, this is seen as '&'...

   A.




On Wed, Nov 11, 2020 at 9:27 AM Spar <[hidden email]> wrote:
Hello, Lua.
I want to share some of my stuff I made for Lua that might be helpful or interesting to someone here.

1. Lua Patterns Viewer
A tool to analyze, inspect and learn patterns.
The tool has just started working, any help is welcome.

2. Lua Infographics
A collection of charts and infographics about Lua such as:
- Lua libraries names, dependencies and pureness.
- Lua activity and popularity.
- Lua speed benchmarks (From 1.0 to 5.4.1).


--
Andrea Vitali






Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Spar
Hi, thanks for the report. Fixed.

On Wed, Nov 11, 2020 at 8:43 PM Andrea <[hidden email]> wrote:
'$' at the end of the pattern should anchor to end of string

but if one follows the link the example indicates that '&' at the end of the pattern anchors to end of string

if one overwrites the example by typing a single '$' as pattern, this is seen as '&'...

   A.




On Wed, Nov 11, 2020 at 9:27 AM Spar <[hidden email]> wrote:
Hello, Lua.
I want to share some of my stuff I made for Lua that might be helpful or interesting to someone here.

1. Lua Patterns Viewer
A tool to analyze, inspect and learn patterns.
The tool has just started working, any help is welcome.

2. Lua Infographics
A collection of charts and infographics about Lua such as:
- Lua libraries names, dependencies and pureness.
- Lua activity and popularity.
- Lua speed benchmarks (From 1.0 to 5.4.1).


--
Andrea Vitali






Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Ranier Vilela-2
In reply to this post by Spar
Em qua., 11 de nov. de 2020 às 14:27, Spar <[hidden email]> escreveu:

2. Lua Infographics
A collection of charts and infographics about Lua such as:
- Lua libraries names, dependencies and pureness.
- Lua activity and popularity.
- Lua speed benchmarks (From 1.0 to 5.4.1).
I don't think fibonacci is a good test for benchmarks, with dynamic languages like Lua.
LuaJIT, like C, has the ability at compile time, to process and save the block result:
repeat
fact (16)
i = i + 1
until i> = 100000
So, like C, it only takes 0.01s to get the result.

Ranier Vilela

Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Spar
Hi Ranier.
The Fibonacci test was chosen because it was the first that came to my mind, I took it from PIL. But yeah it seems not fair to compare Lua 5.4 with LuaJIT in the conclusion.
I also had to use `repeat until` because Lua didn't have for loops until version 4.0.  
What benchmark example do you suggest instead?

On Wed, Nov 11, 2020 at 11:26 PM Ranier Vilela <[hidden email]> wrote:
Em qua., 11 de nov. de 2020 às 14:27, Spar <[hidden email]> escreveu:

2. Lua Infographics
A collection of charts and infographics about Lua such as:
- Lua libraries names, dependencies and pureness.
- Lua activity and popularity.
- Lua speed benchmarks (From 1.0 to 5.4.1).
I don't think fibonacci is a good test for benchmarks, with dynamic languages like Lua.
LuaJIT, like C, has the ability at compile time, to process and save the block result:
repeat
fact (16)
i = i + 1
until i> = 100000
So, like C, it only takes 0.01s to get the result.

Ranier Vilela

Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Ranier Vilela-2
Em qua., 11 de nov. de 2020 às 19:20, Spar <[hidden email]> escreveu:
Hi Ranier.
The Fibonacci test was chosen because it was the first that came to my mind, I took it from PIL. But yeah it seems not fair to compare Lua 5.4 with LuaJIT in the conclusion.
I also had to use `repeat until` because Lua didn't have for loops until version 4.0.  
What benchmark example do you suggest instead?
Here has some:

seems challenging for Lua 5.4 ...

regards,
Ranier Vilela
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Spar
Almost every test uses functions that are not available from the beginning of Lua. Nucleotide uses metatables for example.
This benchmark test is aimed more to measure VM speed rather than RAM/features abilities.
I might use ack benchmark or stay with the current one.

On Thu, Nov 12, 2020 at 2:01 AM Ranier Vilela <[hidden email]> wrote:
Em qua., 11 de nov. de 2020 às 19:20, Spar <[hidden email]> escreveu:
Hi Ranier.
The Fibonacci test was chosen because it was the first that came to my mind, I took it from PIL. But yeah it seems not fair to compare Lua 5.4 with LuaJIT in the conclusion.
I also had to use `repeat until` because Lua didn't have for loops until version 4.0.  
What benchmark example do you suggest instead?
Here has some:

seems challenging for Lua 5.4 ...

regards,
Ranier Vilela
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Ranier Vilela-2
Em qua., 11 de nov. de 2020 às 20:24, Spar <[hidden email]> escreveu:
Almost every test uses functions that are not available from the beginning of Lua. Nucleotide uses metatables for example.
This benchmark test is aimed more to measure VM speed rather than RAM/features abilities.
I might use ack benchmark or stay with the current one.
Of course.

One question, why variable "i", is not declared as local?

regards,
Ranier Vilela
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Spar
Because older versions of Lua had more strict scopes.
If you try to run this script in Lua 1.0 (Up to Lua 2.1) it will error:
"
$debug
local i = 123
repeat
    local I = 321
    print(i, I)
    i = i + 1
until i > 1000
"

Output:
"
nil
123
lua: unexpected type at conversion to number
        in statement begining at line 6 of file "benchmark.lua"
"

Since I test Lua VM and not trying to squeeze the performance I decided to preserve it as global for the entire benchmark. Am I wrong with this statement?

On Thu, Nov 12, 2020 at 2:39 AM Ranier Vilela <[hidden email]> wrote:
Em qua., 11 de nov. de 2020 às 20:24, Spar <[hidden email]> escreveu:
Almost every test uses functions that are not available from the beginning of Lua. Nucleotide uses metatables for example.
This benchmark test is aimed more to measure VM speed rather than RAM/features abilities.
I might use ack benchmark or stay with the current one.
Of course.

One question, why variable "i", is not declared as local?

regards,
Ranier Vilela
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Ranier Vilela-2
Em qua., 11 de nov. de 2020 às 21:02, Spar <[hidden email]> escreveu:
Because older versions of Lua had more strict scopes.
If you try to run this script in Lua 1.0 (Up to Lua 2.1) it will error:
"
$debug
local i = 123
repeat
    local I = 321
    print(i, I)
    i = i + 1
until i > 1000
"

Output:
"
nil
123
lua: unexpected type at conversion to number
        in statement begining at line 6 of file "benchmark.lua"
"

Since I test Lua VM and not trying to squeeze the performance I decided to preserve it as global for the entire benchmark. Am I wrong with this statement?
Of course not.
But local i, favors 5.4.
In my tests, makes 0.054s

regards,
Ranier Vilela
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Sudipto Mallick
> not trying to squeeze the performance

As the Lua language have evolved over such a long time, in my humble
opinion, you should write the benchmarking programs in the most
''natural'' way possible for each (major?) version to account for the
improvements in the language.

~smlckz
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Viacheslav Usov
In reply to this post by Spar
On Wed, Nov 11, 2020 at 11:20 PM Spar <[hidden email]> wrote:

> The Fibonacci test

The fact() function in your benchmark scripts computes the factorial,
as its name implies, not the Fibonacci number as you claim elsewhere.

Cheers,
V.
Reply | Threaded
Open this post in threaded view
|

Re: Lua Patterns Viewer and Lua Infographics announcement

Spar
Thanks everyone for the feedback.
> you should write the benchmarking programs in the most
''natural'' way possible
Thanks for this detail I missed, smlckz.

>  not the Fibonacci number
I knew about it just an hour before your message, that's a big mistake for sure, I apologize, thanks, Viacheslav.

I was working on the new version all day, I'm ready to publish updated graphs.
The conclusion stays the same but:
- Fixed description
- Changed os.clock to precise CPU clock API
- The page now has 2 charts: runtime and compile time of each Lua version
- Each test is now written "naturally". That means, when "for statement" is available, the script is rewritten. "write" function was moved to "io.write": rewritten, etc.

I'm still open for suggestions because I don't know everything, if I made I mistake or you know how to improve it, please let me know (probably in GitHub Issues, to not spam lua-l)

On Thu, Nov 12, 2020 at 12:42 PM Viacheslav Usov <[hidden email]> wrote:
On Wed, Nov 11, 2020 at 11:20 PM Spar <[hidden email]> wrote:

> The Fibonacci test

The fact() function in your benchmark scripts computes the factorial,
as its name implies, not the Fibonacci number as you claim elsewhere.

Cheers,
V.