Thursday, March 28, 2024

Super C++

 The last documents about my imaginer programming language, are living documents and I'll be expanding them time to time, so check back here time to time to see if the have changed.

Saturday, March 23, 2024

More Super C++

 
NOTE: This is a living document and I'll be updating it time to time, so 
check back time to time.

Pricing 

Lets ignore the pricing for now and just talk about an intersting idea.

Binaires 

I went to collage for programming and not university, so it's hard for me to think of what the bytecode for this would be. It would be simple and classes would mantian they structure but be "flattened" to functions, if this is possible. This would in my mind, increase running speed. 

Binaries would be in .bin files. A bat file(or luncher if bats don't run on a platform) would lunch the bytecode runner and run the bytecode. They would be diffrent types of binnears depending on the header. The different types would have slighty different bytecode structures. The two structures I can think of would be "library" and "executable". They might be third for services. (i.e. Web Server)

Resources 

Resources like images and sounds could be enbeeded in the executable like with Windows executables.

Threading 

The threading API would be like that of C#/Java. They would be no resvired words for threading(so no "synchronized or "lock"), this should make the language less confusing for beginners. 

Mac OS 9 and Freedos 

Mac OS 9 is another weird platform I would want to support. Both OS 9 and Freedos don't support Premtive Mutitasking, so the binnery runner would inplment it's own task handler.(like a primtive version of what win 98 does). 

Requesting more time or ending early 

Requesting more time

On platforms that supported it(Freedos and OS 9 would because we implemented the multitasking, not sure about others), you could ask for a bigger timeslice. You can ask for up to 500MS. You can not "double dip" if you asked once, further asks are ignored. If a debugger is attached, you get a debug message but this, kind of deafets the perpuse of asking for more time, so if you have none, it's just outright ignored.

Ending early 

You can also end early like Java's yeid.

Freedos 

System requrments

The Freedos version would only run on "newer" machines(386/486/Pentium wiht 8 - 16 MB of ram). It would need to run in Proteced Mode. This would mean(depending on implementation) that it may not run in Windows 3.1 but they would also be a Windows 3.1 version of Super C++.

Functionality 

Basic Functionality

Everything in the "System.bin" library would work but other parts of Super C++ may not be implemented on Freedos. They would also be an IDE. 

GUI 

The standard GUI API would use a port of Curses to draw instead of the OS's windowing system.

Sound 

A native(none-bytecode) application would be used to select the users sound card and then Super C++ applications could play sounds. The application would have drivers for common MIDI and PCM audio. This will include many common modern motherboard audio cards.(Some of which allready have drivers for dos). This "soundsetup.exe"(it's x86 dos) would be in the same folder as the Super C++ executable and would be run automatically when the user runs the installer.(see the next section).

Basic 

A Basic(not Microsoft Visual Basic) compiler would also exist only for Freedos and it would compile to the same bytcode.(like you see in .Net). This is because Basic was a common language back in the day.

Installation

The SDK would come with a tool to make installers. You could make an installer for any platform supported by Super C++. It would install the framework(if you don't have it) and your app.

Goto 

Goto would exist like in normal C++. 

Coding conventions

The docs would use Java coding conversions. 

More about primitives

Date 


GUID 

I think having GUIDs at the core of the language would be important because they are found often in modern project(that use databases and/or internet). GUID would be a primative written as "guid" and they is a "makeGUID" function in the "System" libary but you can also make your own.(if you say generated it elsewhere and wanted to use it). The syntax for this would be as follows.guid myUniqueValue = {deaf0319-f920-4ef3-b13b-6f94f9e3582b};

Propiteres 

C# propitiate would exist. 

More on annotations 

These can be used for documentation kind of like JavaDoc. They can also be used to add custom literals for objects. Operator overloads would work like in C++.  

Function pointers 

Function pointers would exist and would be used in the way JavaScript does it, simple and clean. The C# event handler syntax would also exist. 
 

Collections

They would be a rebost collections API like C#/Java. 

AnythingArray 

As I said in the last part, not all objects extended Object. Also primaties are not Autoboxed(unlike C#/Java). Instead they is a Number object that you must manually box numbers in. string is an object, like in C++/C#/Java and like in C#, it's also a "primitive". 

The AnythingArray object is like C#/Java's "Object[]" array, in that it can catian anything even primaties. 

Generics 

Exist and are like in C#/Java. 

More about enums

Super C++ lets you loop through enums with a special function. This is similar to C#.




Friday, March 22, 2024

Super C++

This entry assumes you have an understanding of programming terms. It would be read best by someone who can program in Java or C#. I have an idea for a programming language. I would call it "Super C++" and it would be similar to the Java and C# I am fimieleir with. Anything that I don't describe here would work the way it does in C#. 

Order of thins in this document 

The things in this document are in the order I am thinking of them. If they is enough interest I'll expand on this.

Explaining everything 

I will not explain the syntax of everthing, I don't have the time for that, you can Google the syntaxes of things I make refences too.

Language type

Super C++ would be a compile type language that would compile to byte code like C#/Java so code would be portable. Since it's an imanginary language I would imagine it being on almost every platform including odd ones like Freedos.  

Overload on return type 

You could overload on return type in the language. The compile would try and figure out which overload to use and error if it can't. If it errors(or if you want to be explicit about it) you can mannualy tell it which one to use.

Figuring it out 

If we have two methods with a signature like this:  

void doOverload(){};
int doOverload(){};

The compiler would know which one to use based on the value assigned to it. Example: 

int x = doOverload();

Calls the bottom one and

doOverload();

Calls the top. 

 

doThing(doOverload()) Is the same as 

int x = doOverload();
doThing(x);
And the compiler would see this "shorthand" and know which one to call. 

In cases where it can't guess, you would get a compiler error and have to select one annually.

Manually calling the correct method

You could manually call the correct method like this: 
[void] doOverload();

If your casting(say to a byte) it would look like this: 

(byte)[int] doOverload();

Objects 

In C#/Java everything is an object(even where your main method goes) but this is not the case in Super C++.(like normal C++). Java/C# derive all objects from the "Object" class and one can override "ToString()" and other methods if you want. I find this can be confusing, so they would be a "BaseObject" class but Object don't have to inherit from it. 

The syntax for object would be that of C#/Java which is a lot easeir to understand. Namspaces would exist like in C#/C++.  

An update utility would exist to convert C++ classes to the new syntax.

 

Inheritance

Multiple inheritance would be supported like C++.

Exceptions

They would NOT be Java's silly Checked Execptionts. They would be a CompilerWarnerOnException class which wuld generate compiler warnsing if you don't handle it.

Header files 

For backwards compatibility from normal C++, Super C++ would support "Header Files". 

Pointers 

Pointers exist in C# and Java, the just hide it. An Object Refrence is a C++ pointer under the hood. 

Pointer math would exit in Super C++for backwards compatibly with normal C++. Using it would generate compiler "notices"(less server then warnings). They MAY be technical limitations because it's a byte-code language. 

 

Structs and Enums,

Would work like C#. 

Garbage Collection 

Would work like C#/Java.

Math

"^" is "too the power of instead of "exclusive or". All bitwise opporastions are now functions from the Math library. This should be make the language easier to use for begginers. 

Strings 

They would be one type of string and it would be like the one in Java/C#. That one is immutable, these strings would be muttable. 

Primitives

Would be the same as C# + guid and date.
 

Compiler messages

Would be a bit easier to understand then current langues. 

API 

Would be very close to the C# one, the GUIs would be built on top of something ultra potable. No APIs that help you code "Digital Rights Mangemnt" would exist(you could code this but we want help you) because DRM in generally a bad thing.

Annotations

Would work like in C# and can extend the Super C++ compiler. 

Copryright info 

The byte-code would include copyright info. 

Closing thoughts

I hope you found that interesting to read. Let me know if you have any questionts. Check back here for follow up posts from time to time.


 

 

 



Friday, March 1, 2024

Library Terms

So I know a lot of library terms. In 2020 I participated in "Library Connect Line". I could talk twice a week for 30 minutes to a library staff member. I used my time to ask them about everything I was curious about like "why do some staff members have 'Library Associate' in they email address instead of "Librarian"?
("The answer is Librarian" is a step up the job ladder above Library Associate)

The most interesting term was when I learned the term "Weeding The Collection" which means getting ride of books, the library does not want. When  I said this to another staff member at Brampton or Guelph, She said "You work at the library now!?". I told the staff member(Mary) I do Library Connect with and apparently this term is not really used by none-staff. So they you go I know a super-nerdy library term and now you do too! Inprease your library friends!