• Re: OK, what looks better. The OLD tcl-oo or the NEW tcl-oo?

    From aotto1968@21:1/5 to All on Tue Jan 28 23:00:51 2025
    I'm still struggling with myself as to whether "myoo" should be reference-based or namespace-based.
    after doing some research with the tcl-only API, I've now switched to C. Unfortunately, the public namespace C API is rather
    weak and only "string" based, which has now prompted me to switch to the semi-public "Int" API, where at least there is usable
    "namespace" support. After the first analysis, I can now say that "namespace-based" is currently faster.

    package require libmyoox
    1.0

    ::myooX::ClassN ::MyClassN {
    proc MyClassN {myNs num} {
    namespace upvar $myNs my my
    set my(num) $num
    }
    proc get {myNs} {
    namespace upvar $myNs my my
    set my(num)
    }
    }
    ::MyClassN::cls

    ::myooX::ClassN ::MyClassR {
    proc MyClassR {myRef num} {
    upvar $myRef my
    set my(num) $num
    }
    proc get {myRef} {
    upvar $myRef my
    set my(num)
    }
    }
    ::MyClassR::cls

    set ns1 [::myooX::NewN ::MyClassN 1]
    ::MyClassN::MyClassN-1
    set ref2 [::myooX::NewR ::MyClassR::cls 2]
    ::MyClassR::MyClassR-1::my

    ::MyClassN::get $ns1
    1
    ::MyClassR::get $ref2
    2

    time {::myooX::NewN ::MyClassN 1 } 10000
    10.244 microseconds per iteration
    time {::myooX::NewR ::MyClassR::cls 2 } 10000
    15.086 microseconds per iteration

    time {::MyClassN::get $ns1 } 10000
    1.6015 microseconds per iteration
    time {::MyClassR::get $ref2 } 10000
    2.4201 microseconds per iteration

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Wed Feb 5 10:49:18 2025
    First "sign of life" from the merger of "libmyoo" with the "ALC-compiler"

    TCL now has a new OO subsystem where the class is defined either in TCL or in C/C++, which means an enormous gain in flexibility
    depending on the application. With "theLink" your class is not only a LOCAL part of your application, but connects when required
    with the shadow class in another application in another programming language locally or somewhere else in the network.

    https://www.facebook.com/permalink.php?story_fbid=pfbid06TEVHK2eTdWA8BKGDhbTnxdgU6VCKiikfJLjpHbTP2MQywKC6YNsyrEGPStiaD4zl&id=100069563501101

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Fri Jan 10 09:43:07 2025
    OK, what looks better. The OLD tcl-oo or the NEW tcl-oo?

    The NEW tcl-oo is:
    much EASIER to use than the OLD tcl-oo
    can be compiled into pure C code using the TCL compiler
    follows the "command-first" philosophy of Tcl
    can be used from Tcl 8.0...
    much faster than the OLD tcl-oo

    https://www.facebook.com/permalink.php?story_fbid=pfbid02s4Wo3VokUzCXfuXzqdMepTcrhDtWHghuUggQ7Hsr8BtvbaZPZrtqAyvQ8V7733GAl&id=100069563501101

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Thu Jan 16 22:14:35 2025
    libmyoo initial release - project setup, coding, testing and documentation.

    libmyoo is an attempt to rethink the topic of Object-Oriented-Programming (OOP) in TCL, offering a maximum of
    Object-Oriented-Programming (OOP) functionality with minimal effort.

    The aim is to offer an identical API via both C and TCL, taking into account the integration in the meta-code-compiler
    (META-COMPILER) as well as in the TCL-COMPILER.

    project page including code -> http://thedev.nhi1.de/theLib/main/index.htm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Thu Jan 23 22:29:25 2025
    NEWS FROM: 23 Jan, 2025

    Adding the libmyoo library as C/binary code and revising the API.

    The performance-critical part was rewritten in C, whereby the TCL and C implementations are equal and interchangeable.
    The validation of the myoo extension was carried out using tcltest and thus the API was finally defined at the same time.

    Now the time has come: myoo is not only available as tcl-only but also as c-tcl-only.

    http://thedev.nhi1.de/theLib/main/index.htm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Thu Jan 30 20:22:33 2025
    Array versa Namespace
    =====================

    ‍I struggled with whether myoo should be array-reference-based or namespace-reference-based.

    After doing some research with the tclmyoo TCL-API and libmyoo C-API I switch to namespace-reference-based

    The following reasons led to the switch to namespace-reference :

    - With TclGetNamespaceFromObj from the tcl internal Int API, a very powerful tool is available for resolving a namespace.
    - It has been confirmed that "namespace upvar NS my my" is significantly faster than "upvar NS::my my".
    - To call a sub-method, the local-reference no longer needs to be resolved because the instance-namespace is always used
    for the global namespace (::).
    - An external-pointer can also be attached to the tcl internal Tcl_Namespace* pointer, which speeds up the
    All-Language-Compiler (ALC) compiler massively.
    - The code becomes much smaller and simpler by switching to the namespace-reference, so that I can proudly say that myoo is
    by far the smallest Object-Oriented-Programming (OOP) in the world.
    - Even with the tcl-only version, tclmyoo is faster than tcloo with over ten years of development work.

    read more at: http://thedev.nhi1.de/theLib/main/index.htm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Sat Jan 25 21:55:32 2025
    something for tcl internal specialists ... who has the fastest 'my'

    http://thedev.nhi1.de/theLib/main/myoo-performance-variants-my.htm

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From aotto1968@21:1/5 to All on Sun Mar 30 14:18:35 2025
    On 10.01.25 09:43, aotto1968 wrote:
    OK, what looks better. The OLD tcl-oo or the NEW tcl-oo?

    The NEW tcl-oo is:
    much EASIER to use than the OLD tcl-oo
    can be compiled into pure C code using the TCL compiler
    follows the "command-first" philosophy of Tcl
    can be used from Tcl 8.0...
    much faster than the OLD tcl-oo

    https://www.facebook.com/permalink.php? story_fbid=pfbid02s4Wo3VokUzCXfuXzqdMepTcrhDtWHghuUggQ7Hsr8BtvbaZPZrtqAyvQ8V7733GAl&id=100069563501101

    UPDATE myoo → Optimization is still in progress, but the first results show that the new "namespace-based" TCL-OO (myoo)
    extension is 20% faster than the traditional "command-based" TCL-OO (oo) extension, with python-oo still being 20% ​​faster than
    the new TCL-OO (myoo) and 40% faster than the traditional TCL-OO (oo)
    Purely strategically, however, the new TCL-OO extension (myoo) has the advantage that the "brutal-force" compiler "Tcl2C"
    accelerates the "myoo" code to such an extent that we can now talk about "C speed with TCL" and no longer just "PYTHON speed."

    https://www.facebook.com/permalink.php?story_fbid=pfbid0315uLRXFuajwF5RdBBHEo8XRsHc3q8yQ9knpZWzWTq7Z1q7VBgB3QFUsS46mox8X8l&id=100069563501101

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)