[Langdev] - Capabilities [2]
Just dumping some thoughts I had a while ago and forgot to post here. Tephra is still on my mind.
What should the language be able to do?
- systems programming - direct memory access, allocation, manipulation
- graphical applications - built in vector/matrix types for usability - creating GUIs, windows, graphics primitives
- pointer arithmetic
- should follow C's path of modular libraries? Header files?
Tephra stdlib
This has been an interesting problem I've been thinking about - nowadays what do people consider necessary for a programming language's standard library?
- Structures for maps, lists, etc (strings and regex);
- File manipulation;
- GUI drawing (hardware accelerated or software rendered - will necessitate assembly routines);
- Networking? This is less important for Tephra, at least for now. But given I'm looking for C interop, there's a possibility for it to be used as glue code or something, so basic TCP/UDP stuff;
- Maybe a debugger as well?
Types
// guaranteed size types
uint8/u8;
uint16/u16;
uint32/u32;
uint64/u64;
uchar(?); // 1 byte
// precise pointer types for granular memory management
ptr_int8;
ptr_int16;
ptr_int32;
ptr_int64;
ptr_char;
ptr_void;
// architecture dependent
int;
char;
double;
bool;
float;
word(?);
string(?);
void(?);
// binary, hex, octal, decimal types
0x; // hex prefix
0b; // binary prefix
0o; // octal prefix
0d; // decimal prefix
// logical types/bitwise operators
&; // bitwise AND
|; // bitwise OR
^; // bitwise XOR
~; // bitwise NOT
<<; // bitshift left
>>; // bitshift right
^<<; // xorl (for faster zeroing of a register)
&&; // logical AND
||; // logical OR
Functions
File I/O Open/close/read/write - bytestream? Copy/Cut/Delete
Considering C's approach to file management/file I/O:
Using a stream of bytes [input stream] from a console/terminal/external program;
open stream identified by FILE*
fprintf();
fread();
fwrite();
I'm still in the dark about what more to add. But I'll keep doing my readings and hacking away at these problems until something clicks.