teikalang / teika

MIT License
318 stars 7 forks source link

{teija,jsend}: proper let handling #175

Closed EduardoRFS closed 11 months ago

EduardoRFS commented 11 months ago

Goals

Faster, smaller and closer to source code, let generation.

Context

Currently let is erased in Teika during typing, this is the case just because at the time(yesterday) this was the simplest implementation. This leads to bigger and slower code in general as let will multiply the value, removing sharing.

Here the implementation of let is hackish but should work, by passing an aliases parameter to every function involved.

Additionally JSEnd was improved to properly generate blocks containing const definitions. Making the let code gen reasonable.