Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMUUI (Stack Machine Unified User Interface) or simply FireFORTH (any legal implication?) -- extension for Firefox

102 views
Skip to first unread message

lsng....@gmail.com

unread,
Oct 3, 2018, 5:10:49 AM10/3/18
to
SMUUI (Stack Machine Unified User Interface) or simply FireFORTH (any legal implication?) -- extension for Firefox

Just to update about my plan now:

(1) managed to compile Firefox from source. It was much easier than I thought.

The correct way is given here:

https://developer.mozilla.org/en-US/docs/Mozilla/Developer_guide/Build_Instructions/Simple_Firefox_build/Linux_and_MacOS_build_preparation

(2) Now I will start work on SMUUI (Stack Machine Unified User Interface) or simply FireFORTH (any legal implication?)

Summary: The Stack Machine Unified User Interface (SMUUI) is an extension of the ubiquitous Unix terminal and the Browser Console, with Reverse Polish Notation commands and facilities, to interface to high level functions in high level programming languages, as well as low level Forth-type assembly instructions. It is essential in the era of Cryptocurrency Browser Mining, as even novice users would like to be sure they can control and monitor the computer or mobile device down to a single clock cycle.

BCPL, grandfather of C, has a stack machine architecture. Bourne, worked with Burroughs Algol before joining the Unix team, gave rise to the ubiquitous Bourne shell. dc, was a stack machine. SMUUI is a return to the original path.

There was a need for Unix to be portable to non-stack machine architecture, as manufacturer of microprocessors and computers then would produce register machines as well as stack machines.

lsng....@gmail.com

unread,
Oct 4, 2018, 3:26:32 AM10/4/18
to
On Wednesday, October 3, 2018 at 5:10:49 PM UTC+8, lsng....@gmail.com wrote:
> Summary: The Stack Machine Unified User Interface (SMUUI) is an extension of the ubiquitous Unix terminal and the Browser Console, with Reverse Polish Notation commands and facilities, to interface to high level functions in high level programming languages, as well as low level Forth-type assembly instructions. It is essential in the era of Cryptocurrency Browser Mining, as even novice users would like to be sure they can control and monitor the computer or mobile device down to a single clock cycle.

Just to report my progress if anyone is interested to collaborate:

1) I have joined Firefox DevTools Slack group #general and #console.

I posted a brief introduction about SMUUI. Just waiting for replies.


2) Here's backtrace from gdb of Firefox -- running alert("hi") from Console, then Ctrl-C back to gdb. It might give us an idea the code structure and decide which file to change to put in a Forth(-ish) shell:

(Username replaced with ....)

Thread 1 "firefox" received signal SIGINT, Interrupt.
0x00007fffe7ef2707 in s_mp_mul_2d (mp=0x7fffc36b9568, d=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/security/nss/lib/freebl/mpi/mpi.c:2937
2937 for (pa += dshift; pa < alim;) {
(gdb) backt
#0 0x00007fffe7ef2707 in s_mp_mul_2d (mp=0x7fffc36b9568, d=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/security/nss/lib/freebl/mpi/mpi.c:2937
#1 0x00007fffe7ef4f61 in mp_read_radix (mp=<optimized out>, str=<optimized out>, radix=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/security/nss/lib/freebl/mpi/mpi.c:2534
#2 0x00007fffe7efedd2 in initialize_roots (arr=<optimized out>, values=<optimized out>, inverted=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/third_party/prio/prio/config.c:43
#3 0x00007fffe7efedd2 in PrioConfig_new (n_fields=<optimized out>, server_a=<optimized out>, server_b=<optimized out>, batch_id=0x7fffd1cc90c0 "", batch_id_len=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/third_party/prio/prio/config.c:93
#4 0x00007fffea425eea in mozilla::dom::PrioEncoder::Encode(mozilla::dom::GlobalObject&, nsTString<char> const&, mozilla::dom::PrioParams const&, mozilla::dom::RootedDictionary<mozilla::dom::PrioEncodedData>&, mozilla::ErrorResult&) (aGlobal=..., aBatchID=..., aPrioParams=..., aData=..., aRv=...)
at ..../devel/Firefox/src/swacker-dbg/dom/prio/PrioEncoder.cpp:114
---Type <return> to continue, or q <return> to quit---
#5 0x00007fffe93851e6 in mozilla::dom::PrioEncoder_Binding::encode(JSContext*, unsigned int, JS::Value*) (cx=0x7fffdfa23800, argc=<optimized out>, vp=0x7fffdb2f2788)
at ..../devel/Firefox/src/swacker-dbg/obj-x86_64-pc-linux-gnu/dom/bindings/PrioEncoderBinding.cpp:428
#6 0x00007fffeb966fcc in CallJSNative(JSContext*, bool (*)(JSContext*, unsigned int, JS::Value*), JS::CallArgs const&) (native=0x3c, cx=<optimized out>, args=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:461
#7 0x00007fffeb966fcc in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (cx=0x7fffdfa23800, args=..., construct=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:553
#8 0x00007fffeb961334 in js::CallFromStack(JSContext*, JS::CallArgs const&) (cx=<optimized out>, args=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:613
#9 0x00007fffeb961334 in Interpret(JSContext*, js::RunState&) (cx=<optimized out>, state=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:3451
#10 0x00007fffeb958bfc in js::RunScript(JSContext*, js::RunState&) (cx=0x7fffdfa23800, state=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:440
#11 0x00007fffeb96731b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (cx=0x7fffdfa23800, args=..., construct=<optimized out>)
---Type <return> to continue, or q <return> to quit---
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:580
#12 0x00007fffebad7576 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>) (cx=0x7fffdfa23800, frame=0x7fffffffa348, stub_=<optimized out>, argc=<optimized out>, vp=0x7fffffffa2b0, res=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/jit/BaselineIC.cpp:3810
#13 0x0000134177257d98 in ()
#14 0x00007fffffffa290 in ()
#15 0x00007fffffffa270 in ()
#16 0xfff9800000000000 in ()
#17 0x00007fffed788360 in js::jit::DoCallFallbackInfo ()
at ..../devel/Firefox/src/swacker-dbg/obj-x86_64-pc-linux-gnu/dist/bin/libxul.so
#18 0x00001341772824e3 in ()
#19 0x0000000000004822 in ()
#20 0x00007fffffffa348 in ()
#21 0x00007fffd3847680 in ()
#22 0x0000000000000001 in ()
#23 0x00007fffffffa2b0 in ()
#24 0xfffe7fffd2ec5188 in ()
#25 0xfff9800000000000 in ()
---Type <return> to continue, or q <return> to quit---
#26 0xfffe7fffd24565f0 in ()
#27 0x00007fffffffa378 in ()
#28 0x00007fffd3847680 in ()
#29 0x000013417765e2f0 in ()
#30 0x0000000000009821 in ()
#31 0xfffe7fffd24565f0 in ()
#32 0xfff9800000000000 in ()
#33 0xfffe7fffd2ec5188 in ()
#34 0xfffe7fffc3bd9460 in ()
#35 0xfffe7fffd2456520 in ()
#36 0xfffb7fffdb163720 in ()
#37 0xfffe7fffd2456520 in ()
#38 0xfffa80000000000b in ()
#39 0xfffe7fffd2ec5188 in ()
#40 0xfffe7fffd2456170 in ()
#41 0xfff9000000000001 in ()
#42 0xfffe7fffc3bd9460 in ()
#43 0xfffe7fffd2456520 in ()
#44 0x0000000000000000 in ()


lsng....@gmail.com

unread,
Oct 4, 2018, 9:13:17 AM10/4/18
to
On Thursday, October 4, 2018 at 3:26:32 PM UTC+8, lsng....@gmail.com wrote:
> 2) Here's backtrace from gdb of Firefox -- running alert("hi") from Console, then Ctrl-C back to gdb. It might give us an idea the code structure and decide which file to change to put in a Forth(-ish) shell:

Here's another backtrace in Firefox. It looks as if JavaScript jit is also a stack machine:

#0 0x00007fffebf55105 in js::InterpreterStack::pushInvokeFrame(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (this=0x7fffdfa23918, cx=0x7fffdfa23800, args=..., constructing=js::NO_CONSTRUCT)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Stack.cpp:462
#1 0x00007fffeb958ed9 in js::InvokeState::pushInterpreterFrame(JSContext*) (this=<optimized out>, cx=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:370
#2 0x00007fffeb958ed9 in js::RunState::pushInterpreterFrame(JSContext*) (this=0x7fffffff9e30, cx=0x7fffdfa23800)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:384
#3 0x00007fffeb958ed9 in Interpret(JSContext*, js::RunState&) (cx=0x7fffdfa23800, state=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:2147
#4 0x00007fffeb958bfc in js::RunScript(JSContext*, js::RunState&) (cx=0x7fffdfa23800, state=...)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:440
#5 0x00007fffeb96731b in js::InternalCallOrConstruct(JSContext*, JS::CallArgs const&, js::MaybeConstruct) (cx=0x7fffdfa23800, args=..., construct=<optimized out>)
at ..../devel/Firefox/src/swacker-dbg/js/src/vm/Interpreter.cpp:580
#6 0x00007fffebad7576 in js::jit::DoCallFallback(JSContext*, js::jit::BaselineFrame*, js::jit::ICCall_Fallback*, unsigned int, JS::Value*, JS::MutableHandle<JS::Value>

lsng....@gmail.com

unread,
Oct 4, 2018, 9:27:05 AM10/4/18
to
On Thursday, October 4, 2018 at 9:13:17 PM UTC+8, lsng....@gmail.com wrote:
> On Thursday, October 4, 2018 at 3:26:32 PM UTC+8, lsng....@gmail.com wrote:
> > 2) Here's backtrace from gdb of Firefox -- running alert("hi") from Console, then Ctrl-C back to gdb. It might give us an idea the code structure and decide which file to change to put in a Forth(-ish) shell:
>
> Here's another backtrace in Firefox. It looks as if JavaScript jit is also a stack machine:

Reference article:

https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/

Liang Ng

unread,
Oct 5, 2018, 9:40:31 PM10/5/18
to
On Thursday, 4 October 2018 21:27:05 UTC+8, lsng....@gmail.com wrote:
> Reference article:
>
> https://hacks.mozilla.org/2017/02/a-crash-course-in-just-in-time-jit-compilers/

Here's a good point to start. annotate-page is an example where user text input can be accepted into Firefox, the first step to make a Forth-ish shell:

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Examples

https://github.com/mdn/webextensions-examples/tree/master/annotate-page

Name Description
annotate-page Displays a sidebar that lets you take notes on web pages.

JavaScript APIs
storage.local
tabs.onActivated
tabs.onUpdated
tabs.query
windows.getCurrent
0 new messages