Recent submissions

Comment · 3 years ago
LMAO will do, check again in some minutes.

-Shogun

Comment · 3 years ago
Division yielding always a float is a python issue, in python you would use the floor division to get integers, but you cant do the same in plain shark because other target platforms might not have it.

You can disregard and ignore most floating to int conversions and checks if youre NOT targeting python. Other platforms generally have just double precision and no integers (incluiding the C and Java ones) but not happening in python.

In your example x[1] == 1 yields true in any platform. So dont worry.

The for loop will iterate exacly end - start times with a start of 0 if missing and finish after end - 1 has executed.

Using the iteration variable after loop exit is undefined behavior, some platforms keep the last value stored like python and javascript, others will make a wild assignment to a global variable every time like lua or the C/Java editions.

Functions do NOT have variable lenght calls, if you read the code a second time, what its doing is looking up an array based in arguments length, and proceeding to switch on each case.

Hope this helped, will update the handbook if something is unclear.

- Shogun

Comment · 3 years ago
Thats why you should refer to it as GS or GShark XD. I was aware of it so no worries
Comment · 3 years ago
The code compiles and runs very cleanly and smoothly under win32 and linux mint. This is probably an issue of size_t being different sized in a platform or the code using int64_t everywhere but int is 32 bit. Thanks (and is not ironic).

Shogun

Comment · 3 years ago
Most the weight of the binaries is in the GameShark framework. You can get a tiny binary by erasing all files under /bin except shark(.exe) and system.shar
Comment · 3 years ago
Shark doesnt solves any problem you could not solve with other languages, its just better at handling a whole wide range of problems others cant solve. Have you dreamed making the frontend and backend of your site in the same language, or building the same game in PC, Mobile and Nintendo 3DS from the same codebase and just a few commands? I do, and shark is my attempt at doing it.

- Shogun

Comment · 3 years ago
There could be many, thanks for pointing it out O U O
Comment · 3 years ago
Not happening. If you compile something to Lua assigning a key to nil will erase it, python and javascript will keep it. Pheraps making a special NullObject value to fill these slots would be a good idea, but you could not interact seamlessly with the target system and probably get a speed penalty.

Having the exact behavoir in all platforms is not possible in some cases, and these are the cases left 'undefined' in the handbook.

Hope this clears things a bit ;)

Cheers, -Shogun

Comment · 3 years ago
I like swift and rust quite actually. Might make a shark VM from scratch in swift for the heck of it. :)
Comment · 3 years ago
Just tell GCC to shut up and try again, if persistent make an issue in GH.

Shark used to stand for SHAred ARKitecture, since the language can compile to lua, python and javascript using the shared architecture found in the three. Now it stands for nothing really.

Edit: Typo check O _ O

Comment · 3 years ago
I liked NIM btw. But shark is not about a faster python, it ofers quite a few advantages: speed, size, hackability, ambiguity and lookahead free grammar, and foremost an insane portability and repertorie of libraries to use. The shark compiler is a few thousand lines but its output can be run as python, javascript, lua, java and native.

Cheers, -Shogun

Comment · 3 years ago
The standard python distro does lift a good 27-30 MB depending on version and offers lots of optional (but generally useful) libraries. The standard shark SDK distro lifts under 13 MB and also offers some precompiled libs (mostly game and graphics related). I dont know how heavy is python with utilities stripped but shark weigths 50 KB and depends barely on libc, this includes the interpreter, compiler, linker and standard libraries like system.path and system.io. In this respect shark is very even with lua and many small-medium sized lisps.

Cheers, - Shogun

Comment · 3 years ago
A extremely portable programming language and game framework i made from scratch.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton