Package: untypedscript-utsc
UntypedScriptProject that branched off of the discontinuedPogScript, with a considerably different JavaScript-like syntax. UntypedScript's goal is to become an easy-to-understand and easy-to-write language with speeds comparable to that of C or C++. Version1.0.0of the language will be published and available for download as soon as floats are introduced and error throwing is fixed (see thetodo list). The todo list is not necessarily based on an order of priority, although many low-priority tasks are near the end of the list.Boils down to assembly code. As per the name, includes no form of a type system - you are on your own! Type hints may be introduced in the future. Sample Hello World - (other programs can be found intests/)importputsfrom"<libc>"constmain=()=>{puts("Hello World!")return0}export{main}Compile it withutsc -e helloworld.utsand runhelloworld.exe, or just runutsc -r helloworld.uts! (You need NASM and MinGW installed - currently only tested on Windows)Note that structs in this langauge are very limited - they cannot be nested (i.e. you cannot have a struct member whose type is a struct) or returned from functions unless their type is declared explicitly. For example, take the following code:import{printf}from"<libc>"structPerson{name,age}structCar{owner}constget_person=()=>{// WILL WORKconststructPersonperson=["Joe",23]returnperson// WILL ALSO WORK (produces same effect as the above code, since types don't actually exist and the structs are just syntax sugar for arrays)return["Joe",23]// WILL NOT WORKreturn(structPerson["Joe",23])}constmain=()=>{// WILL NOT WORKprintf(get_person().name)// WILL WORKconststructPersonperson=get_person()printf(person.name)// -----------------------------------------conststructCarmycar=[person]// WILL NOT WORKprintf(mycar.owner.name)// WILL WORKconststructPersoncar_owner=mycar.ownerprintf(car_owner.name)}export{main}In this manner, many operations with structs require implicit casts and to some extent wastage of memory. Dynamic objects do not need these implicit casts, but are much slower than structs and will also take up more memory than them (even with struct implicit casting), so structs are still recommended for objects that are not created arbitrarily at runtime.Structs vs. ObjectsAt the moment (although the test conducted is very small), there seems to be a neglibile performance difference while using structs versus using objects. They average out at 25.14575ms for structs and 25.843025ms for objects. However, it is important to note that the struct average would be about one millisecond lower if there was no outlier.Next on the list to do:Test on Linux systemImport and insert AST expressionsDifferent types of functionsInline functions (ideas/optimization/funcs)Pure functions (ideas/optimization/funcs)Stack-allocated functions -> this will probably not become a feature, the idea was replaced with thelocalonlyfunction featureSolve recursion errors in parserRemove weird parser bugs that result in a lot of errors (ongoing, constant task)FloatsLiteralsArithmetic (maybe thru functions because the language is untyped)OptimizationsAdd asm optimizations (in progress, constant task)Type hinting for optimizationOther optimizations from compiler collected info, type inferencing, and predefined knowledge of libc functionsCompiler speed optimizationsLanguage information (constantly in progress)Language Specification/StandardDocsElif Blocks (not else-ifs)For loops64-bit programs and typesHoist global-level funcsInline asmTry-catch blocksAllow for stdcall functionsExpand async libraryAddstackalloc (int)andstackalloc[int]DLL integrationImportsExportsFix DLL CompilationDynamic ObjectsObject integration with C structsObject destructuringMay integrate a sort of lightweight runtime in the future (for a try-catch framework, etc.) that itself runs on the C runtimeIf this is added there will be an option to compile with the UTS runtime and an option to compile without the runtime (both executables will be standalone (as long as the C runtime exists), the UTS runtime will be automatically linked into the output)VSCode extensionNotesFor the moment, \uXXXX and \XXXX escape codes are not permitted, and may continue to not be permitted in the future (this feature may never be added)