Shapeless https://github.com/kyegomez/Poly

Embrace Shapelessness, The Design Philosophy of the Future.

Shapeless programming is an all-new methodology of programming that creates radical flexibility, versatility, and fluidity in software programs.

Kye Gomez
9 min readSep 8, 2023

--

In the world of software development, the need for flexibility, versatility, and fluidity is paramount.

The ability to adapt and evolve is what sets apart the good from the great.

This is where Shapeless programming comes in.

It’s an all-new methodology that encourages radical flexibility, versatility, and fluidity in software programs.

It’s a revolutionary approach that is set to redefine how we think about and interact with programming languages.

Download Shapeless now!

pip install shapeless

And, here’s the repository!

The Current State of the Programming

In the current world of programming, we are shackled by the constraints of static typing.

It’s like being forced to navigate the vast ocean of creativity with an antiquated map and a broken compass.

We are bound by the rigid rules and structures that dictate what we can and cannot do. This rigidity stifles our creativity and hampers our ability to innovate.

Consider the simple task of creating a function that adds two numbers in a statically typed language like Java:

public int add(int a, int b) {
return a + b;
}

This function works perfectly fine as long as you feed it integers.

But what if you want to add two floating-point numbers?

Or two strings? You would need to create separate functions for each data type:

public float add(float a, float b) {
return a + b;
}

This is not only tedious but also inefficient.

It’s like having to build a new road every time you want to drive to a different destination.

It’s a waste of time and resources.

And what about languages like C++, where you have to manage memory manually?

It’s like being forced to dig a well every time you want a glass of water.

It’s not only exhausting but also prone to errors.

One wrong move and you could end up with a memory leak, causing your program to consume more and more memory until it eventually crashes.

int* ptr = new int(5);
// ... some code ...
delete ptr; // Forget this and you have a memory leak

These are just a few examples of the limitations and frustrations of static typing and manual memory management.

There are countless more.

Every day, developers around the world waste countless hours wrestling with these issues.

Hours that could have been spent on more productive tasks, like solving complex problems or creating innovative features.

And it’s not just about efficiency.

It’s also about the joy of programming.

The joy of creating something from nothing.

The joy of seeing your code come to life.

But how can we experience this joy when we are constantly bogged down by the rigid rules and structures of static typing?

How can we soar in the sky of creativity when we are chained to the ground of conformity?

This is the sad reality of the current state of the world in programming.

A world where creativity is stifled, innovation is hampered, and efficiency is compromised.

A world where we are forced to conform to the rigid rules and structures of static typing.

The Challenge..

The challenge in achieving this future is monumental.

It’s like trying to climb a mountain that’s constantly shifting and changing.

It’s a battle against the inherent complexity of dynamic typing, a battle that many have fought and lost.

Dynamic typing offers flexibility and versatility, but it also introduces a host of potential issues.

Type errors are a common occurrence in dynamically typed languages.

They can occur at any time, often when you least expect them.

They are like landmines, waiting to explode and wreak havoc on your code.

Consider a simple example in Python, a dynamically typed language:

def add(a, b):
return a + b

This function works perfectly fine as long as you feed it data of compatible types.

But if you try to add an integer and a string, it raises a TypeError.

This is a common issue in dynamically typed languages.

You never know when a type error will occur until it actually happens.

And then there’s the issue of performance overhead.

Dynamic typing requires more computational resources than static typing.

It’s like trying to run a marathon with a heavy backpack.

It slows you down and drains your energy.

In Python, for example, every operation involves a type check.

This is necessary to ensure that the operation is valid for the given data types.

But it also adds a significant performance overhead.

It’s like having to check your passport every time you cross a border.

It’s necessary, but it slows you down.

def add(a, b):
return a + b # This involves a type check

Moreover, the current tools and languages that support dynamic typing often lack the features and capabilities needed to fully leverage its benefits.

They lack the ability to handle types in a fluid and flexible manner, without sacrificing the benefits of static typing.

For example, in JavaScript, a dynamically typed language, you can change the type of a variable at any time.

But this flexibility comes at a cost. It can lead to unpredictable behavior and hard-to-find bugs.

It’s like driving on a road that changes direction without warning.

It’s flexible, but it’s also dangerous.

let x = 1;  // x is a number
x = 'Hello, World!'; // Now x is a string

These are just a few examples of the challenges in achieving the future of programming.

There are countless more.

Every day, developers around the world struggle with these issues.

They struggle to climb the mountain of dynamic typing, only to be knocked down by the avalanche of type errors and performance overhead.

But it doesn’t have to be this way.

There is a better way.

A way that embraces the flexibility and versatility of dynamic typing, without the pitfalls.

This is the way of Shapeless programming.

It’s a revolutionary approach that is set to redefine how we think about and interact with programming languages.

It’s about breaking free from the chains of static typing and embracing the flexibility and versatility of dynamic typing.

It’s about creating programs that are fluid, versatile, and adaptable.

It’s about synchronizing with The Way and creating a harmonious balance between technology and nature.

This is the future of programming, and it’s time we embrace it.

Programming Re-Imagined

The future of programming should be a world where developers are free to express their creativity and innovation.

A world where they are not bound by the rigid constraints of static typing.

A world where they can create programs that are flexible, versatile, and adaptable.

But this future is not possible without a radical shift in our approach to programming.

This shift is what Shapeless programming offers.

Imagine a world where you can create a function that can handle any type of data.

A function that can add two integers, two floating-point numbers, or even two strings without any modifications.

This is possible with Shapeless programming.

In Python, for example, you can create a function that can handle any type of data using the Poly class from the Shapeless package:

pip install shapeless
from shapeless import Poly

def add(a: Poly, b: Poly):
return a + b

This function can handle any type of data, as long as the + operator is defined for that data type.

You can use it to add two integers, two floating-point numbers, or even two strings:

print(add(Poly(1), Poly(2)))  # Outputs: 3
print(add(Poly(1.5), Poly(2.5))) # Outputs: 4.0
print(add(Poly('Hello, '), Poly('World!'))) # Outputs: 'Hello, World!'

This is the power of Shapeless programming.

It allows you to create programs that are flexible, versatile, and adaptable.

It allows you to break free from the chains of static typing and soar in the sky of creativity.

But the benefits of Shapeless programming go beyond flexibility and versatility.

It also provides thread safety, which is crucial for multi-threaded applications.

It ensures that the data remains consistent and prevents race conditions.

Furthermore, Shapeless programming provides logging, type aliasing, type annotation, type extension, and serialization and deserialization features.

These features make it easier to write, debug, and understand the code, and they allow developers to create more complex and flexible data structures.

The future of programming is Shapeless programming.

It’s a revolutionary approach that is set to redefine how we think about and interact with programming languages.

It’s about breaking free from the constraints of static typing and embracing the flexibility and versatility of dynamic typing.

It’s about creating programs that are fluid, versatile, and adaptable.

It’s about synchronizing with The Way and creating a harmonious balance between technology and nature.

This is the future of programming, and it’s time we embrace it.

Why Me?

As the creator of Shapeless programming, I have a deep understanding of the problems with static types.

I fucking hate them.

It’s digital prison.

I have spent years studying and experimenting with different approaches to programming.

I have seen the limitations of static typing and the potential of dynamic typing.

I have seen the need for a new approach, one that combines the best of both worlds.

I have created Shapeless programming to meet this need.

It’s a powerful tool that allows developers to handle data types dynamically and polymorphically.

It provides thread safety, logging, type aliasing, type annotation, type extension, and serialization and deserialization features.

These features make it easier to write, debug, and understand the code, and they allow developers to create more complex and flexible data structures.

Download now:

pip install shapeless

And get started here!

Conclusion

In conclusion, Shapeless programming is the future of programming.

It’s a revolutionary approach that is set to redefine how we think about and interact with programming languages.

It’s about breaking free from the constraints of static typing and embracing the flexibility and versatility of dynamic typing.

It’s about creating programs that are fluid, versatile, and adaptable.

It’s about synchronizing with The Way and creating a harmonious balance between technology and nature.

Join us on this journey and experience the future of programming today.

Here is the TaoMorphic hub which influences all of my design principles:

And, the shapeless package which manifests TaoMorphism into reality!

And, Join the Agora discord to be about of the journey and to contribute and or receive technical support!

--

--