Giter Club home page Giter Club logo

snecs's Introduction

snecs

snecs

A straightforward, nimble ECS for Python.

PyPI PyPI - Python Version PyPI - Implementation Mypy: checked GitHub

snecs is a pure Python 3.6+, dependency-free ECS library, heavily inspired by Rust’s Legion, and aiming to be as fast and easy-to-use as possible.

Scroll down to learn more, or check out the documentation!

Overview

snecs is an ECS library, written from the ground up to be:

Straightforward!

The snecs API is designed to be both easy-to-use, and encourage cleanly structured code. It follows a simple principle - functions do things, classes represent things - in an attempt to reduce the incidence of antipatterns like ClassesAsNamespaces.

Nimble!

snecs is written with a benchmark-driven approach. Every statement in the hot path is benchmarked against alternative ways to express the same behavior, to let your code run as fast as you need it to.

One of the design goals is outrunning esper, and eventually I’ll have a benchmark suite to post here.

Dependency-free!

snecs has no dependencies whatsoever, other than Python 3.6 or higher; you won’t need to worry about deprecation warnings from dependencies, or having to install systemwide libraries for dependencies to work - because there are none! Installing snecs is as simple as running:

$ pip install snecs

Pure Python!

snecs is written entirely in Python. It does not use any modules written in C or any other language, which means that you don’t have to worry about needing a C compiler if there are no wheels for your platform and distribution, and that it works perfectly under PyPy, and gets the full benefit of its JIT compiler and optimizations.

Fully typed!

snecs is checked against a very aggressive mypy configuration to catch bugs and let you fully enjoy the library even when writing type-annotated code. You won’t have to # type: ignore any use of snecs.

Lovingly-commented!

Over a third of the non-blank lines in the snecs/ directory are comments. If you ever need to dive into the code to see how snecs works under the hood, they will guide you through the source and explain every workaround, optimization, and obscure trick you might find non-obvious.

License

snecs is made available under the terms of the Mozilla Public License Version 2.0, the full text of which is available here, and included in LICENSE. If you have questions about the license, check Mozilla’s MPL FAQ.

snecs's People

Contributors

hexdecimal avatar slavfox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

snecs's Issues

Add Comonent Typing

Can seem to figure out the issue on this one:

CleanShot 2022-06-24 at 15 05 36@2x

Seems the mypy typings are off

Implicit world default parameter.

A lot of functions take a world parameter but if you ever forget to add it then an implicit default world will be used instead. I'm paranoid that I'll forget to add this parameter somewhere which will create a bug I can't track down easily.

Have you considered other ways of handling this? I see that other libraries often put all of their main functionality in methods of their world object instead of as separate objects, or removing the implicit world as a default parameter could be done instead, or another class could be added which encapsulates both the world and the ECS functions which use it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.