Skip to content

StaticObject to optimize super dynamic way that JS use #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions proposal-template.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,37 @@
# ECMAScript proposal: @Name
# ECMAScript proposal: StaticObject to optimize

- [Motivation](#motivation)
- [High-level API](#high-level-api)
- [FAQ](#faq)

## Motivation

Proposal motivation
Обьект в JS настолько динамичен по своей природе что заставляет разработчиков браузеров делать всякие
hidden классесс и тд, но что если мы разрешим использовать динамический обьект так же по умолчаннию, но сделаем возможность
крутой оптимизации, но как?

```js
class UserService extends StaticObject {
public a;
}
```

И когда кто-то попробует сделать:

```js
const service = new UserService();

// JS скажет нет / спс
service.awesmefield = 5;
```

Пока я тут веселюсь с написание компилируемого TS (https://github.com/ovr/StaticScript), я понимаю что если компилировать JS
можно было бы точно круто оптимизировать, что в EXE/ELF/MACH-O, что в webassembly

Мотивация:

- Оптимизация
- Запрещение расширение объекта

## High-level API

Expand Down