User talk:Zzo38/Programming languages with unusual features

From Esolang
Jump to navigation Jump to search
#include <stdio.h>
#include <iostream.h>
__int8 a=53; int main(){cout << a << endl;return 0;}

Some compilers print 53 normally. Others only print the 5 and leave out the 3.[citation needed] It doesn't work on Try it online.

Not unusual

Some of these features you list are not unusual IMO.

BANCStar: Block statements are (presumably) built-in to and executed by the VM, rather than being translated by a compiler at first.

BASIC and Forth has had that forever. In fact, NEXT without FOR is error number 1 in BASIC interpreters these days.

dc: although it does not have arithmetic IF, it would probably be much better if it did;

The x86_32 architecture was like that for a very long time. Eventually they fixed it by adding conditional move statements.

FurryScript: No negative integer literals (although negative numbers are possible)

That feature was blessed by our prophets K&R, and remains in modern C.

OASYS: There are no general procedures, only methods that can be called on objects.

You mean like in smalltalk or java?

OASYS: Pointer variables cannot be stored in save games (but OAC does not support pointer variables); normally pointer values exist only on the stack.

Like any C program these days in most cases: almost always if you use malloc and point to malloced variables, or in a dynamic library, or if your system uses address-space randomization.

OAC: Static type checking is done to distinguish integers from strings even though they are actually interchangeable in the VM.

Just like in C or Fortran.

OAC: No operators are needed for property accessing and method calls, nor are parentheses needed around the argument list or commas in between the arguments; just spaces will do.

No punctuation for method calls is in smalltalk, and no punctuation for argument lists is in LOGO, but yes, the combination is unusual.

OAC: No optimization is done by the compiler.

That was the norm until the nineties.

b_jonas 19:46, 17 May 2017 (UTC)

It is true some things aren't that unusual. However, the "only methods that can be called on objects" is not quite like Java; all objects even have the same set of methods, so there are no static methods either. All methods other than the init method need an object to be called on. Also, in C the strings will use pointers not numbers so it is a bit different. OASYS will store all global variables and all objects in the save file; this is common in some VMs, although it won't even complain if you make a global variable with a pointer value; it just won't save properly. OASYS doesn't even have malloc and so on; pointer values point to static allocations, local variables, and object properties (which are dynamically allocated, although objects are saved in the save file). You say BASIC and Forth have block statements forever. Depending on the implementation of BASIC it might or might not compile in the proper addresses at first, but that is the source format anyways. With Forth, the addresses will be compiled in; IF will push the address to the stack at compile-time and THEN will then read that address and then put in there a pointer to the current address (what exactly is done depends on the implementation though). About arithmetic IF, well, what I really meant is the way which conditions work in dc which just isn't very good in my opinion, and with the way the rest of the dc is working it seem better to me if it is using arithmetic IF instead of the other way. But you do have some good points anyways. --Zzo38 (talk) 00:52, 19 May 2017 (UTC)