Skip to main content

UntypedScript

Project that branched off of the discontinued PogScript, 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++. Version 1.0.0 of the language will be published and available for download as soon as floats are introduced and error throwing is fixed (see the todo 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 in tests/)

import puts from "<libc>"

const main = () => {
	puts("Hello World!")

	return 0
}

export { main }

Compile it with utsc -e helloworld.uts and run helloworld.exe, or just run utsc -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>"

struct Person
{
	name, age
}

struct Car
{
	owner
}

const get_person = () => {
	// WILL WORK
	const struct Person person = ["Joe", 23]

	return person

	// 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 WORK
	return (struct Person ["Joe", 23])
}

const main = () => {
	// WILL NOT WORK
	printf(get_person().name)

	// WILL WORK
	const struct Person person = get_person()
	printf(person.name)


// -----------------------------------------

	const struct Car mycar = [person]

	// WILL NOT WORK
	printf(mycar.owner.name)

	// WILL WORK
	const struct Person car_owner = mycar.owner

	printf(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. Objects

At 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.

Chart of Struct vs. Object Performance

Next on the list to do:

  • Test on Linux system
  • Import and insert AST expressions
  • Different types of functions
    • Inline functions (ideas/optimization/funcs)
    • Pure functions (ideas/optimization/funcs)
    • Stack-allocated functions -> this will probably not become a feature, the idea was replaced with the localonly function feature
  • Solve recursion errors in parser
  • Remove weird parser bugs that result in a lot of errors (ongoing, constant task)
  • Floats
    • Literals
    • Arithmetic (maybe thru functions because the language is untyped)
  • Optimizations
    • Add asm optimizations (in progress, constant task)
    • Type hinting for optimization
    • Other optimizations from compiler collected info, type inferencing, and predefined knowledge of libc functions
    • Compiler speed optimizations
  • Language information (constantly in progress)
    • Language Specification/Standard
    • Docs
  • Elif Blocks (not else-ifs)
  • For loops
  • 64-bit programs and types
  • Hoist global-level funcs
  • Inline asm
  • Try-catch blocks
  • Allow for stdcall functions
  • Expand async library
  • Add stackalloc (int) and stackalloc[int]
  • DLL integration
    • Imports
    • Exports
    • Fix DLL Compilation
  • Dynamic Objects
    • Object integration with C structs
    • Object destructuring
  • May integrate a sort of lightweight runtime in the future (for a try-catch framework, etc.) that itself runs on the C runtime
    • If 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 extension

Notes

  • For 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)

Metadata

Release files for untypedscript-utsc 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for untypedscript-utsc 1.0.3
File Size Uploaded Provenance Actions
untypedscript-utsc-1.0.3.tar.gz 32.7 kB Without provenance Details for untypedscript-utsc-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for untypedscript-utsc 1.0.3
File Interpreter ABI Platform Actions
untypedscript_utsc-1.0.3-py3-none-any.whl Python 3 none any Details for untypedscript_utsc-1.0.3-py3-none-any.whl

Total release size: 71.2 kB

Release files / untypedscript-utsc-1.0.3.tar.gz

Download URL untypedscript-utsc-1.0.3.tar.gz
Size 32.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1a6c8817c633b298e31201a4e1fe4f482270de0393b5871e0dc87cc7c5f09c86
BLAKE2b-256 checksum
How to use checksums
4dbf74e24964d02ba373d9c6fcaa8b05401fa284e057bd757d2dc837f3cd101f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Release files / untypedscript_utsc-1.0.3-py3-none-any.whl

Download URL untypedscript_utsc-1.0.3-py3-none-any.whl
Size 38.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2a3ff25bc91db1d0249ccd22c989a9dfe24a27f830d56533cd7d9cc28b84f04a
BLAKE2b-256 checksum
How to use checksums
9c02fa3d5307d124c355c884356ed463dc836707fb36db4015e0b1490dda2839
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.7

Security for untypedscript-utsc 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page