@scriptc/compiler 0.0.12 → 0.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +141 -15
  2. package/dist/backend/cc.d.ts +8 -0
  3. package/dist/backend/cc.js +12 -0
  4. package/dist/backend/cc.js.map +1 -1
  5. package/dist/backend/emission/emit-exprs.js +138 -12
  6. package/dist/backend/emission/emit-exprs.js.map +1 -1
  7. package/dist/backend/llvm/emitter.js +43 -6
  8. package/dist/backend/llvm/emitter.js.map +1 -1
  9. package/dist/frontend/lowering/crypto-tables.d.ts +7 -0
  10. package/dist/frontend/lowering/crypto-tables.js +139 -0
  11. package/dist/frontend/lowering/crypto-tables.js.map +1 -0
  12. package/dist/frontend/lowering/lower-builtins.d.ts +38 -20
  13. package/dist/frontend/lowering/lower-builtins.js +111 -39
  14. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  15. package/dist/frontend/lowering/lower-calls.js +8 -0
  16. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  17. package/dist/frontend/lowering/lower-classes.js +10 -2
  18. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  19. package/dist/frontend/lowering/lower-exprs.js +69 -7
  20. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  21. package/dist/frontend/lowering/lower-modules.js +1 -1
  22. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  23. package/dist/frontend/lowering/lower-server.d.ts +21 -0
  24. package/dist/frontend/lowering/lower-server.js +267 -12
  25. package/dist/frontend/lowering/lower-server.js.map +1 -1
  26. package/dist/frontend/lowering/lower-stmts.js +4 -4
  27. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  28. package/dist/frontend/lowering/lower-stream.js +1 -1
  29. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  30. package/dist/frontend/lowering/lowerer.d.ts +21 -3
  31. package/dist/frontend/lowering/lowerer.js +48 -8
  32. package/dist/frontend/lowering/lowerer.js.map +1 -1
  33. package/dist/frontend/lowering/surfaces.d.ts +6 -0
  34. package/dist/frontend/lowering/surfaces.js +76 -0
  35. package/dist/frontend/lowering/surfaces.js.map +1 -1
  36. package/dist/frontend/types.js +12 -0
  37. package/dist/frontend/types.js.map +1 -1
  38. package/dist/index.js +6 -1
  39. package/dist/index.js.map +1 -1
  40. package/dist/ir/nodes.d.ts +99 -9
  41. package/dist/ir/nodes.js +52 -1
  42. package/dist/ir/nodes.js.map +1 -1
  43. package/dist/ir/validate.js +52 -4
  44. package/dist/ir/validate.js.map +1 -1
  45. package/package.json +2 -2
  46. package/surface-manifest.json +286 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scriptc/compiler",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "The scriptc compiler — TypeScript/JavaScript frontend, typed IR, LLVM and C backends",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scriptc.dev",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "typescript": "7.0.2",
32
32
  "typescript5": "npm:typescript@5.9.3",
33
- "@scriptc/runtime": "0.0.12"
33
+ "@scriptc/runtime": "0.0.13"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node node_modules/typescript5/bin/tsc -p tsconfig.json"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "compilerVersion": "0.0.12",
3
+ "compilerVersion": "0.0.13",
4
4
  "coverage": [
5
5
  "Entries are projected mechanically from the compiler's own decision tables: the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib and node-builtin lowering tables, and the supported-builtin-module list. Nothing is hand-maintained; the manifest regenerates byte-identically from the source tree at this version.",
6
6
  "Absence from this manifest means 'not projected', never 'unsupported'. Surfaces lowered through dedicated code paths rather than tables are not yet projected: console, JSON, Promise/async and the timer surface, the net/http/tls/https/dgram/dns/assert/test/stream/readline module member surfaces, template literals, the regex slice, global functions (parseInt, parseFloat, isNaN, isFinite), and the process surface outside its ambient slice.",
@@ -519,6 +519,46 @@
519
519
  "status": "static",
520
520
  "note": "recognized module (bare and node:-prefixed specifiers)"
521
521
  },
522
+ {
523
+ "id": "node-builtin.crypto.createCipheriv",
524
+ "kind": "node-builtin",
525
+ "name": "crypto.createCipheriv",
526
+ "status": "unsupported",
527
+ "code": "SC2020",
528
+ "note": "symmetric ciphers need a cipher stack the static runtime does not vendor — the lowered crypto surface is hashing, randomness, and the introspection statics"
529
+ },
530
+ {
531
+ "id": "node-builtin.crypto.createDecipheriv",
532
+ "kind": "node-builtin",
533
+ "name": "crypto.createDecipheriv",
534
+ "status": "unsupported",
535
+ "code": "SC2020",
536
+ "note": "symmetric ciphers need a cipher stack the static runtime does not vendor — the lowered crypto surface is hashing, randomness, and the introspection statics"
537
+ },
538
+ {
539
+ "id": "node-builtin.crypto.createDiffieHellman",
540
+ "kind": "node-builtin",
541
+ "name": "crypto.createDiffieHellman",
542
+ "status": "unsupported",
543
+ "code": "SC2020",
544
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
545
+ },
546
+ {
547
+ "id": "node-builtin.crypto.createDiffieHellmanGroup",
548
+ "kind": "node-builtin",
549
+ "name": "crypto.createDiffieHellmanGroup",
550
+ "status": "unsupported",
551
+ "code": "SC2020",
552
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
553
+ },
554
+ {
555
+ "id": "node-builtin.crypto.createECDH",
556
+ "kind": "node-builtin",
557
+ "name": "crypto.createECDH",
558
+ "status": "unsupported",
559
+ "code": "SC2020",
560
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
561
+ },
522
562
  {
523
563
  "id": "node-builtin.crypto.createHash",
524
564
  "kind": "node-builtin",
@@ -527,6 +567,182 @@
527
567
  "code": "SC2020",
528
568
  "note": "the one lowered shape is the composed chain createHash(\"sha256\").update(data).digest(\"hex\") — the Hash handle itself has no lowering"
529
569
  },
570
+ {
571
+ "id": "node-builtin.crypto.createHmac",
572
+ "kind": "node-builtin",
573
+ "name": "crypto.createHmac",
574
+ "status": "unsupported",
575
+ "code": "SC2020",
576
+ "note": "HMAC has no lowering yet — the lowered crypto surface is randomUUID, randomBytes, the createHash(\"sha256\"|\"sha1\") chain, and the introspection statics"
577
+ },
578
+ {
579
+ "id": "node-builtin.crypto.createPrivateKey",
580
+ "kind": "node-builtin",
581
+ "name": "crypto.createPrivateKey",
582
+ "status": "unsupported",
583
+ "code": "SC2020",
584
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
585
+ },
586
+ {
587
+ "id": "node-builtin.crypto.createPublicKey",
588
+ "kind": "node-builtin",
589
+ "name": "crypto.createPublicKey",
590
+ "status": "unsupported",
591
+ "code": "SC2020",
592
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
593
+ },
594
+ {
595
+ "id": "node-builtin.crypto.createSecretKey",
596
+ "kind": "node-builtin",
597
+ "name": "crypto.createSecretKey",
598
+ "status": "unsupported",
599
+ "code": "SC2020",
600
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
601
+ },
602
+ {
603
+ "id": "node-builtin.crypto.createSign",
604
+ "kind": "node-builtin",
605
+ "name": "crypto.createSign",
606
+ "status": "unsupported",
607
+ "code": "SC2020",
608
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
609
+ },
610
+ {
611
+ "id": "node-builtin.crypto.createVerify",
612
+ "kind": "node-builtin",
613
+ "name": "crypto.createVerify",
614
+ "status": "unsupported",
615
+ "code": "SC2020",
616
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
617
+ },
618
+ {
619
+ "id": "node-builtin.crypto.diffieHellman",
620
+ "kind": "node-builtin",
621
+ "name": "crypto.diffieHellman",
622
+ "status": "unsupported",
623
+ "code": "SC2020",
624
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
625
+ },
626
+ {
627
+ "id": "node-builtin.crypto.generateKey",
628
+ "kind": "node-builtin",
629
+ "name": "crypto.generateKey",
630
+ "status": "unsupported",
631
+ "code": "SC2020",
632
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
633
+ },
634
+ {
635
+ "id": "node-builtin.crypto.generateKeyPair",
636
+ "kind": "node-builtin",
637
+ "name": "crypto.generateKeyPair",
638
+ "status": "unsupported",
639
+ "code": "SC2020",
640
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
641
+ },
642
+ {
643
+ "id": "node-builtin.crypto.generateKeyPairSync",
644
+ "kind": "node-builtin",
645
+ "name": "crypto.generateKeyPairSync",
646
+ "status": "unsupported",
647
+ "code": "SC2020",
648
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
649
+ },
650
+ {
651
+ "id": "node-builtin.crypto.generateKeySync",
652
+ "kind": "node-builtin",
653
+ "name": "crypto.generateKeySync",
654
+ "status": "unsupported",
655
+ "code": "SC2020",
656
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
657
+ },
658
+ {
659
+ "id": "node-builtin.crypto.getCipherInfo",
660
+ "kind": "node-builtin",
661
+ "name": "crypto.getCipherInfo",
662
+ "status": "unsupported",
663
+ "code": "SC2020",
664
+ "note": "symmetric ciphers need a cipher stack the static runtime does not vendor — the lowered crypto surface is hashing, randomness, and the introspection statics"
665
+ },
666
+ {
667
+ "id": "node-builtin.crypto.getDiffieHellman",
668
+ "kind": "node-builtin",
669
+ "name": "crypto.getDiffieHellman",
670
+ "status": "unsupported",
671
+ "code": "SC2020",
672
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
673
+ },
674
+ {
675
+ "id": "node-builtin.crypto.hash",
676
+ "kind": "node-builtin",
677
+ "name": "crypto.hash",
678
+ "status": "unsupported",
679
+ "code": "SC2020",
680
+ "note": "the one-shot digest has no lowering — the composed chain createHash(\"sha256\").update(data).digest(\"hex\") is the lowered hashing surface"
681
+ },
682
+ {
683
+ "id": "node-builtin.crypto.hkdf",
684
+ "kind": "node-builtin",
685
+ "name": "crypto.hkdf",
686
+ "status": "unsupported",
687
+ "code": "SC2020",
688
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
689
+ },
690
+ {
691
+ "id": "node-builtin.crypto.hkdfSync",
692
+ "kind": "node-builtin",
693
+ "name": "crypto.hkdfSync",
694
+ "status": "unsupported",
695
+ "code": "SC2020",
696
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
697
+ },
698
+ {
699
+ "id": "node-builtin.crypto.pbkdf2",
700
+ "kind": "node-builtin",
701
+ "name": "crypto.pbkdf2",
702
+ "status": "unsupported",
703
+ "code": "SC2020",
704
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
705
+ },
706
+ {
707
+ "id": "node-builtin.crypto.pbkdf2Sync",
708
+ "kind": "node-builtin",
709
+ "name": "crypto.pbkdf2Sync",
710
+ "status": "unsupported",
711
+ "code": "SC2020",
712
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
713
+ },
714
+ {
715
+ "id": "node-builtin.crypto.privateDecrypt",
716
+ "kind": "node-builtin",
717
+ "name": "crypto.privateDecrypt",
718
+ "status": "unsupported",
719
+ "code": "SC2020",
720
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
721
+ },
722
+ {
723
+ "id": "node-builtin.crypto.privateEncrypt",
724
+ "kind": "node-builtin",
725
+ "name": "crypto.privateEncrypt",
726
+ "status": "unsupported",
727
+ "code": "SC2020",
728
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
729
+ },
730
+ {
731
+ "id": "node-builtin.crypto.publicDecrypt",
732
+ "kind": "node-builtin",
733
+ "name": "crypto.publicDecrypt",
734
+ "status": "unsupported",
735
+ "code": "SC2020",
736
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
737
+ },
738
+ {
739
+ "id": "node-builtin.crypto.publicEncrypt",
740
+ "kind": "node-builtin",
741
+ "name": "crypto.publicEncrypt",
742
+ "status": "unsupported",
743
+ "code": "SC2020",
744
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
745
+ },
530
746
  {
531
747
  "id": "node-builtin.crypto.randomBytes",
532
748
  "kind": "node-builtin",
@@ -539,6 +755,54 @@
539
755
  "name": "crypto.randomUUID",
540
756
  "status": "static"
541
757
  },
758
+ {
759
+ "id": "node-builtin.crypto.scrypt",
760
+ "kind": "node-builtin",
761
+ "name": "crypto.scrypt",
762
+ "status": "unsupported",
763
+ "code": "SC2020",
764
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
765
+ },
766
+ {
767
+ "id": "node-builtin.crypto.scryptSync",
768
+ "kind": "node-builtin",
769
+ "name": "crypto.scryptSync",
770
+ "status": "unsupported",
771
+ "code": "SC2020",
772
+ "note": "key-derivation functions have no lowering yet — the lowered crypto surface is hashing, randomness, and the introspection statics"
773
+ },
774
+ {
775
+ "id": "node-builtin.crypto.setFips",
776
+ "kind": "node-builtin",
777
+ "name": "crypto.setFips",
778
+ "status": "unsupported",
779
+ "code": "SC2020",
780
+ "note": "a compiled binary has no FIPS provider to enable, and Node itself throws on setFips(true) in a non-FIPS build — getFips() answers 0 here"
781
+ },
782
+ {
783
+ "id": "node-builtin.crypto.sign",
784
+ "kind": "node-builtin",
785
+ "name": "crypto.sign",
786
+ "status": "unsupported",
787
+ "code": "SC2020",
788
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
789
+ },
790
+ {
791
+ "id": "node-builtin.crypto.verify",
792
+ "kind": "node-builtin",
793
+ "name": "crypto.verify",
794
+ "status": "unsupported",
795
+ "code": "SC2020",
796
+ "note": "asymmetric-key operations need a public-key stack (bignum, RSA/EC/EdDSA math) and a KeyObject value model — neither exists in the static runtime, so no faithful lowering can be small; the lowered crypto surface is hashing, randomness, and the introspection statics"
797
+ },
798
+ {
799
+ "id": "node-builtin.crypto.webcrypto",
800
+ "kind": "node-builtin",
801
+ "name": "crypto.webcrypto",
802
+ "status": "unsupported",
803
+ "code": "SC2020",
804
+ "note": "the WebCrypto object has no lowering — the lowered crypto surface is randomUUID, randomBytes, and the createHash chain"
805
+ },
542
806
  {
543
807
  "id": "node-builtin.dgram",
544
808
  "kind": "node-builtin",
@@ -1451,6 +1715,27 @@
1451
1715
  "code": "SC2020",
1452
1716
  "note": "the lowered form is createSecureContext({ cert, key }) — an opaque SecureContext handle for SNI callbacks (http2.createSecureServer accepts SNICallback); other options fence by name"
1453
1717
  },
1718
+ {
1719
+ "id": "node-builtin.tls.getCACertificates",
1720
+ "kind": "node-builtin",
1721
+ "name": "tls.getCACertificates",
1722
+ "status": "static",
1723
+ "note": "the per-type cached PEM bundle: 'default' and 'extra' additionally read NODE_EXTRA_CA_CERTS, 'system' the platform store"
1724
+ },
1725
+ {
1726
+ "id": "node-builtin.tls.rootCertificates",
1727
+ "kind": "node-builtin",
1728
+ "name": "tls.rootCertificates",
1729
+ "status": "static",
1730
+ "note": "the value read; answers the same bundled array as getCACertificates('bundled'), but fenced under its own id — the spelling an author writes"
1731
+ },
1732
+ {
1733
+ "id": "node-builtin.tls.setDefaultCACertificates",
1734
+ "kind": "node-builtin",
1735
+ "name": "tls.setDefaultCACertificates",
1736
+ "status": "static",
1737
+ "note": "replaces the default set and the client trust anchors for the rest of the process"
1738
+ },
1454
1739
  {
1455
1740
  "id": "node-builtin.tty",
1456
1741
  "kind": "node-builtin",