js4vb


Author: Dave
Date: 10.19.25 - 8:08pm



Ok..so this weekend I may have gotten a little carried away and gone on an AI fueled coding bender!

It all started innocently enough...hey Claude, lets try building a JS AST parser in VB6?! Well it nailed it. Then I was all like, hey..how hard is it to implement and interpreter now that we have AST?

And he was all like, thats pretty easy now! So..We did a thing.

Should be pretty stable now. I have tested heavily. Compiles as an ActiveX dll and has some example projects to get you started.
  • vb6 AST parsing to ES5 spec
  • built in interpreter
  • debugger support plus demo Scintinilla UI
  • AddObject support and seamless COM object integration
  • Ability to get COM wrapped JS objects and access late bound! (including function calls and nesting!)
  • ActiveXObject support if UseSafeSubset = false
  • JSON support
  • Array Callback methods: forEach, map, filter, reduce, find, findIndex, some, every
  • Error handling (throw/try/catch/finally)
  • true x64 bit number support (none of that IEEE 754 almost x64 bullshit!)
  • print statement can dump arrays and objects like python
Im under 50hrs still.

The JS/COM wrapping is ridiculous in its own right! You can see more details here.

' Create a JavaScript object
    interp.Execute "var person = { name: 'John', age: 30, city: 'NYC' };"

    ' Get it as a VB COM object!
    Dim person As Object
    Set person = interp.EvalAsObject("person")
    
    ' USE IT LIKE A VB OBJECT!
    Debug.Print "Name: " & person.name       ' "John"
    Debug.Print "Age: " & person.age         ' 30
    Debug.Print "City: " & person.city       ' "NYC"

    ' MODIFY IT!
    person.age = 31
    person.Job = "Developer"                 ' Add new property!


Github Repo

License: MIT (because we should have had this forever ago!)

Dependencies: (all open source)
  • UTypes - for x64 support if you need it stdcall C dll (included)
  • Dynproxy - for the crazy JS as COM (included)
  • Scivb2.ocx - for the debugger GUI Scintinilla Editor
If you dont need any of the above features, you can skip the external dependencies!

One other thing worth adding. I think claude was able to nail this so well because javascript is a very public and common example of a scripting language. It has trained on endless js engine code and discussions. Even when claude was hallucinating, it was using almost identical named variables and constants. When we got to areas of custom coding it was must less definitive. Anyway...its interesting what an AI weekend can bring you!




Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 88 + 23 = ? followed by the letter: Q 



About Me
More Blogs
Main Site
Posts: (All)
2025 (4)
     js4vb
     COM dynamic proxy
     go get lost
     Courier Regular Win11 Missing
2024 (3)
     VB6 JSON
     ffmpeg voodoo
     RegJump Vb
2023 (9)
     VB6 Virtual Files
     File handles across dlls
     python abort / script timeout
     py4vb
     VB6 Python embed w/debugger
     python embedding
     VB6 IDE Enhancements
     No Sleep
     A2W no ATL
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 ( 22 )
2015 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )