9 comments

  • codingdave3 hours ago
    Sounds plausible, but the article itself lists a number of downsides to this, including a statement about potential security problems with a somewhat wishy washy &quot;The input is almost never user-controlled&quot;. That &quot;almost never&quot; is a big red flag to me - sounds like there are known security holes that are being glossed over.<p>So my question is whether there are any real-world scenarios where the performance gains will make a difference to the end customer? Because if not, this framework would bring on the known downsides without a compelling reason for doing so aside from bragging rights of &quot;we&#x27;re the fastest&quot;
  • vmsp43 minutes ago
    Is doing stuff like constant folding pre-execution really worth it? I mean, won&#x27;t the engine itself (V8, JSC, MozJS) be doing it anyway? I know that Google&#x27;s Closure Compiler — probably still the most advanced JS optimized — also does it but I can&#x27;t help but think it&#x27;s probably pointless.
  • hueho2 hours ago
    &gt; Sucrose looks at code and tells the &quot;compiler&quot; to only parse params and skip parsing other parts of the request like body, query, headers entirely as it&#x27;s not need.<p>My understanding is that just offering a request object with lazy accessors would solve this issue, although the accessor itself would have some overhead in repeat accesses.<p>&gt; Elysia has two special optimizations for response mapping functions: mapResponse and mapCompactResponse.<p>This section feels a bit abstract - some transformation examples would be nice.
  • g947o3 hours ago
    &gt; Sucrose read the code without executing it by using Function.toString() then perform our own custom pattern-matching to extract useful information about what parts of the request are actually needed by the route handler.<p>Hmm.
    • pygy_3 hours ago
      Yup, this is a one-time, startup operation, using a proper parser would make it more robust at no runtime cost.
  • Lerc2 hours ago
    I was really confused about what a JIT &quot;Compiler&quot; for a JavaScript framework means, but it turns out it means something like I&#x27;ve done myself.<p>My site <a href="https:&#x2F;&#x2F;c50.fingswotidun.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;c50.fingswotidun.com&#x2F;</a> uses the same trick to generate code for the image generation.<p>Between the confusion of what Compile, JIT, Engine, Runtime, and FrameWork is (which I blame Bun a little bit for starting this entire Runtime&#x2F;Engine confusion). I think we might need some new terminology to describe this method.<p>Maybe a made-up word is needed, JIT was good in that an acronym with a vowel made it wordable and specific.
  • bennett_dev1 hour ago
    I&#x27;m not familiar with Elysia but how does this handle subfunctions? e.g. if my code is<p>const app = new Elysia() .patch(&#x27;&#x2F;user&#x2F;:id&#x27;, (request) =&gt; { return handleUserRequest(request); })<p>or some other custom logic, does it automatically need to fall back to full parsing?
  • NuclearPM2 hours ago
    Frameworks. Plural.
  • bschmidt7003 hours ago
    [dead]