enumer8's blog

[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?

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?

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.