Simple user-defined meta-level to manipulate types of instances as object.

Unfortunately, since the meta-objects are user-defined they are provided without any pre-defined information or behavior. For the same reasons, the Nit OO mechanisms do not rely on this user-defined meta-level.

However meta permits the definition of user-defined meta-classes at any level of meta, even with user-defined meta-loops.

Meta-classes

Meta-classes can be defined easily in 3 steps:

  • define a root for the class hierarchy (eg XObject)
  • define a meta-class (eq XClass[E: XObject] super Class[E])
  • redefine CLASS and class_factory in the root
class XObject
   redef CLASS: XClass[SELF]
   redef class_factory(name) do return new XClass[SELF](name)
end
class XClass[E: XObject] super Class[E] end

var x1 = new XObject
var x2 = new XObject
assert x1.get_class == x2.get_class
assert x1.get_class isa XClass[XObject]
assert x1.get_class.get_class isa Class[XClass[XObject]]

Limitation

Currently works only with the interpreter nit and the compiler with --erasure (without --rta).

--rta will try to detect all the runtime types, and will infinitely discover Class[Class[Class[....]]]. Unfortunately, --separate and --global require --rta.

Moreover, the interpreter and --erasure have a different behavior with generics since with --erasure a single meta-instance is shared for all type variations of a same generic class.

Class names are used as a primary key to identify classes. But name conflicts are not managed and will make the program crashes at runtime (on some cast error)

All subgroups and modules

module meta

meta :: meta

Simple user-defined meta-level to manipulate types of instances as object.
package_diagram meta\> meta core core meta\>->core serialization serialization serialization->meta\> serialization... ... serialization...->serialization

Ancestors

group codecs

core > codecs

Group module for all codec-related manipulations
group collection

core > collection

This module define several collection classes.
group text

core > text

All the classes and methods related to the manipulation of text entities

Parents

group core

core

Nit common library of core classes and methods

Children

group serialization

serialization

Abstract serialization services

Descendants

group a_star

a_star

A* pathfinding in graphs
group android

android

Android platform support and APIs
group app

app

app.nit, a framework for portable applications
group array_debug

array_debug

Exposes functions to help profile or debug Arrays.
group bucketed_game

bucketed_game

Game framework with an emphasis on efficient event coordination
group bundle

android > bundle

A mapping class of String to various value types used by the
group counter

counter

Simple numerical statistical analysis and presentation
group depth

gamnit > depth

gamnit depth, a framework to create portable 3D games in Nit.
group dom

dom

Easy XML DOM parser
group egl

egl

Interface between rendering APIs (OpenGL, OpenGL ES, etc.) and the native windowing system.
group examples

ios > examples

group examples

vsm > examples

group examples

app > examples

group examples

dom > examples

group examples

nlp > examples

group fca

fca

Formal Concept Analysis
group flat

gamnit > flat

Simple API for 2D games, built around Sprite and App::update
group gamnit

gamnit

Portable game and multimedia framework for Nit
group geometry

geometry

Basic geometry data structures and services.
group github

github

Nit wrapper for Github API
group glesv2

glesv2

OpenGL graphics rendering library for embedded systems, version 2.0
group graph

neo4j > graph

Provides an interface for services on a Neo4j graphs.
group intent

android > intent

Services allowing to launch activities and start/stop services using
group ios

ios

iOS support for app.nit
group json

json

read and write JSON formatted text
group linux

linux

Implementation of app.nit for the Linux platform
group mongodb

mongodb

MongoDB Nit Driver.
group more_collections

more_collections

Highly specific, but useful, collections-related classes.
group mpi

mpi

Implementation of the Message Passing Interface protocol by wrapping OpenMPI
group msgpack

msgpack

MessagePack, an efficient binary serialization format
group neo4j

neo4j

Neo4j connector through its JSON REST API using curl.
group network

gamnit > network

Easy client/server logic for games and simple distributed applications
group nitcc_runtime

nitcc_runtime

Runtime library required by parsers and lexers generated by nitcc
group nitcorn

nitcorn

Lightweight framework for Web applications development
group nlp

nlp

Nit wrapper for Stanford CoreNLP
group noise

noise

Noise generators PerlinNoise and InterpolatedNoise
group notification

android > notification

Services to show notification in the Android status bar
group parser_base

parser_base

Simple base for hand-made parsers of all kinds
group popcorn

popcorn

Popcorn
group poset

poset

Pre order sets and partial order set (ie hierarchies)
group service

android > service

Android service support for app.nit centered around the class Service
group sexp

sexp

S-Expression parsing facilities
group shared_preferences

android > shared_preferences

Services allowing to save and load datas to internal android device
group src

android > examples > src

group src

mpi > examples > src

group src

nitcorn > examples > src

group text_stat

text_stat

Injects stat-calculating functionalities to Text and its variants
group ui

android > ui

Views and services to use the Android native user interface
group ui

ios > ui

Implementation of app::ui for iOS
group virtual_gamepad

gamnit > virtual_gamepad

Virtual gamepad mapped to keyboard keys for quick and dirty mobile support
group vsm

vsm

Vector Space Model