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

    From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Fri Jan 10 09:43:07 2025
    From Newsgroup: comp.lang.tcl

    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
    --- Synchronet 3.20a-Linux NewsLink 1.114
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Thu Jan 16 22:14:35 2025
    From Newsgroup: comp.lang.tcl


    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
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Thu Jan 23 22:29:25 2025
    From Newsgroup: comp.lang.tcl


    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
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Sat Jan 25 21:55:32 2025
    From Newsgroup: comp.lang.tcl

    something for tcl internal specialists ... who has the fastest 'my'

    http://thedev.nhi1.de/theLib/main/myoo-performance-variants-my.htm
    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Tue Jan 28 23:00:51 2025
    From Newsgroup: comp.lang.tcl

    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

    --- Synchronet 3.20c-Linux NewsLink 1.2
  • From aotto1968@aotto1968@t-online.de to comp.lang.tcl on Thu Jan 30 20:22:33 2025
    From Newsgroup: comp.lang.tcl

    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

    --- Synchronet 3.20c-Linux NewsLink 1.2