Skip to main content
add line breaks to code examples for readibility
Source Link
//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c)   { return c.count();  }   //c HAS to be a collection, since countElements doesn't make sense otherwise   void addToCollection(Collection& c, vartype v)   { c.append(v)  }   //c is passed by reference here   
int main(string<> args=null)  { printf("hello, world");  return 0;  }   // this code also demonstrates two other features, // default arguments for functions (not explained further) // and immutable lists like string<> (see 6. Built-in datatypes) 
//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c) {return c.count();} //c HAS to be a collection, since countElements doesn't make sense otherwise void addToCollection(Collection& c, vartype v) {c.append(v)} //c is passed by reference here   
int main(string<> args=null){printf("hello, world"); return 0;} //this code also demonstrates two other features, default arguments for functions (not explained further) and immutable lists like string<> (see 6. Built-in datatypes) 
//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c)  { return c.count();  }   //c HAS to be a collection, since countElements doesn't make sense otherwise   void addToCollection(Collection& c, vartype v)   { c.append(v)  }  //c is passed by reference here 
int main(string<> args=null)  { printf("hello, world");  return 0;  }  // this code also demonstrates two other features, // default arguments for functions (not explained further) // and immutable lists like string<> (see 6. Built-in datatypes) 
added 420 characters in body; added 16 characters in body
Source Link
Chinmay Kanchi
  • 6.2k
  • 2
  • 41
  • 51

I'd like the language to be either compiled ahead of time, or JIT compiled, but not purely interpreted, speed being the reason. This ties in to point 1, since an optimising compiler/jitter will have a much easier time optimising statically typed code, and dynamically typed code could simply be left as-is.

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in binary float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
  • A boolean type
  • A null or none type that can be assigned to a variable of any type.
  • Mutable and immutable set types
  • A decimal type which implements decimal floating point variables
  • A fixed type, that implements a fixed-point number

The decimal, float and fixed types should share the exact same public interface (either via inheritance or duck typing), allowing them to be transparently passed to and returned from functions. The parent type could be called real.

I'd like the language to be either compiled ahead of time, or JIT compiled, but not purely interpreted, speed being the reason. This ties in to point 1, since an optimising will have a much easier time optimising statically typed code, and dynamically typed code could simply be left as-is.

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
  • A boolean type
  • A null or none type that can be assigned to a variable of any type.

I'd like the language to be either compiled ahead of time, or JIT compiled, but not purely interpreted, speed being the reason. This ties in to point 1, since an optimising compiler/jitter will have a much easier time optimising statically typed code, and dynamically typed code could simply be left as-is.

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in binary float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
  • A boolean type
  • A null or none type that can be assigned to a variable of any type.
  • Mutable and immutable set types
  • A decimal type which implements decimal floating point variables
  • A fixed type, that implements a fixed-point number

The decimal, float and fixed types should share the exact same public interface (either via inheritance or duck typing), allowing them to be transparently passed to and returned from functions. The parent type could be called real.

added 1450 characters in body; added 97 characters in body; deleted 1 characters in body
Source Link
Chinmay Kanchi
  • 6.2k
  • 2
  • 41
  • 51
//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c) {return c.count();} //c HAS to be a collection, since countElements doesn't make sense otherwise void addToCollection(CollectionCollection& c, vartype v) {c.append(v)} //c is passed by reference here 
int main(String[]string<> args=null){printf("hello, world"); return 0;} //this code also demonstrates anothertwo featureother features, default arguments for functions (not explained further) and immutable lists like string<> (see 6. Built-in datatypes) 

**5. Namespaces **5. Namespaces

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
  • A boolean type
  • A null or none type that can be assigned to a variable of any type.

7. Call by value and by reference

You should be able to call functions by both value and reference, with the default being value (i.e., a copy of the argument is made and operated upon in the function).

8. Pointers

The language should have pointers and allow pointer arithmetic. Pointers can only be statically typed (to avoid the nightmare that is a void*). vartype pointers are explicitly disallowed. Having pointers and pointer arithmetic allows the language to be seriously used as a systems programming language.

9. Inline assembly

In connection with 8., The language should allow inline assembly language code for those situations where it is necessary.

10. Safety

The language should be mostly safe to use, supporting exception handling etc. Pointer arithmetic and inline assembly can be relegated to portions of the code explicitly marked as unsafe. Unsafe code is allowed, but strongly discouraged.

11. Undefined behaviour

The language standard should specify how the program is to behave under all circumstances except in code explicitly marked unsafe, i.e., there should be no undefined behaviour outside of unsafe blocks. This allows the language to be used as a viable application development language, while still allowing you to say, write an OS in it.

//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c) {return c.count();} //c HAS to be a collection, since countElements doesn't make sense otherwise void addToCollection(Collection c, vartype v) {c.append(v)} 
int main(String[] args=null){printf("hello, world"); return 0;} //this code also demonstrates another feature, default arguments for functions 

**5. Namespaces **

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
//variable declarations int anInt = 42 //anInt is now irrevocably an integer and assigning another type to it is an error vartype aVariable = 42 //aVariable is currently an integer, but any type can be assigned to it in the future //function definitions int countElements(Collection c) {return c.count();} //c HAS to be a collection, since countElements doesn't make sense otherwise void addToCollection(Collection& c, vartype v) {c.append(v)} //c is passed by reference here 
int main(string<> args=null){printf("hello, world"); return 0;} //this code also demonstrates two other features, default arguments for functions (not explained further) and immutable lists like string<> (see 6. Built-in datatypes) 

5. Namespaces

  • An int datatype or types. If there is only one int type, it should have unlimited range. If there are more, there should be implicit upcasting into the smallest type capable of holding the result of a computation, with the unlimited range type being the largest.
  • A single built-in float type, which is equivalent to an IEEE 754 double
  • A mutable list type which is implemented as either a doubly linked list or a block of contiguous memory holding pointers to each element
  • An immutable list type that acts like an array but whose size cannot be changed after creation
  • Mutable and immutable string types, with the default being immutable.
  • A map or dict type that is mutable, and holds immutable keys and mutable and/or immutable values.
  • The built-in collection types should be homogeneous typed by default, but can be vartyped if required
  • A boolean type
  • A null or none type that can be assigned to a variable of any type.

7. Call by value and by reference

You should be able to call functions by both value and reference, with the default being value (i.e., a copy of the argument is made and operated upon in the function).

8. Pointers

The language should have pointers and allow pointer arithmetic. Pointers can only be statically typed (to avoid the nightmare that is a void*). vartype pointers are explicitly disallowed. Having pointers and pointer arithmetic allows the language to be seriously used as a systems programming language.

9. Inline assembly

In connection with 8., The language should allow inline assembly language code for those situations where it is necessary.

10. Safety

The language should be mostly safe to use, supporting exception handling etc. Pointer arithmetic and inline assembly can be relegated to portions of the code explicitly marked as unsafe. Unsafe code is allowed, but strongly discouraged.

11. Undefined behaviour

The language standard should specify how the program is to behave under all circumstances except in code explicitly marked unsafe, i.e., there should be no undefined behaviour outside of unsafe blocks. This allows the language to be used as a viable application development language, while still allowing you to say, write an OS in it.

Source Link
Chinmay Kanchi
  • 6.2k
  • 2
  • 41
  • 51
Loading