Skip to content

Have you ever dreamed about a programming language without arrays?

Notifications You must be signed in to change notification settings

northpl93/ArraylessArrays

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Arrayless Arrays

Have you ever dreamed about a programming language without arrays? It's your lucky day.

Project inspired by worse arrays.

Example

public class Example
{
    public static void main(final String[] args)
    {
        final ArrayFactory factory = new ArrayFactory();

        final Array<String> stringArray = factory.getObjectArray(String.class, 10);
        stringArray.set(0, "it works");

        final BooleanArray booleanArray = factory.getBooleanArray(10);
        booleanArray.setBoolean(0, true);
    }
}

Benchmark

Benchmark                          Mode  Cnt     Score     Error  Units
Benchmarks.arraylessArrayFill1000  avgt    3  1787.231 ±  16.024  ns/op
Benchmarks.arraylessArraySetOne    avgt    3     2.631 ±   1.011  ns/op
Benchmarks.javaArrayFill1000       avgt    3   754.024 ± 114.484  ns/op
Benchmarks.javaArraySetOne         avgt    3     1.651 ±   0.461  ns/op

Only one nanosecond lose on each set operation in comparison to native Java arrays.

About

Have you ever dreamed about a programming language without arrays?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages