about summary refs log blame commit diff stats
path: root/profile-parse-trace.arc
blob: 37c85e160667c3aeab76c7737d19ebc63d2706d0 (plain) (tree)




























































































                                                                                       
(load "mu.arc")
(set allow-raw-addresses*)

(reset)
(new-trace "p1")
(add-code:readfile "trace.mu")
(add-code
  '((function! main [
      (default-space:space-address <- new space:literal 30:literal/capacity)
      (x:string-address <- new
"run: main 0: (((1 integer)) <- ((copy)) ((1 literal)))")
      (n:integer <- length x:string-address/deref)
      ($print (("p1 " literal)))
      ($print n:integer)
      ($print (("\n" literal)))
      (s:stream-address <- init-stream x:string-address)
      (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
    ])))
(run 'main)

(reset)
(new-trace "p2")
(add-code:readfile "trace.mu")
(add-code
  '((function! main [
      (default-space:space-address <- new space:literal 30:literal/capacity)
      (x:string-address <- new
"schedule: main
run: main 0: (((1 integer)) <- ((copy)) ((1 literal)))
run: main 0: 1 => ((1 integer))
mem: ((1 integer)): 1 <= 1")
      (n:integer <- length x:string-address/deref)
      ($print (("p2 " literal)))
      ($print n:integer)
      ($print (("\n" literal)))
      (s:stream-address <- init-stream x:string-address)
      (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
    ])))
(run 'main)

(reset)
(new-trace "p3")
(add-code:readfile "trace.mu")
(add-code
  '((function! main [
      (default-space:space-address <- new space:literal 30:literal/capacity)
      (x:string-address <- new
"schedule: main
run: main 0: (((1 integer)) <- ((copy)) ((1 literal)))
run: main 0: 1 => ((1 integer))
mem: ((1 integer)): 1 <= 1
run: main 1: (((2 integer)) <- ((copy)) ((3 literal)))
run: main 1: 3 => ((2 integer))
mem: ((2 integer)): 2 <= 3")
      (n:integer <- length x:string-address/deref)
      ($print (("p3 " literal)))
      ($print n:integer)
      ($print (("\n" literal)))
      (s:stream-address <- init-stream x:string-address)
      (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
    ])))
(run 'main)

(reset)
(new-trace "p4")
(add-code:readfile "trace.mu")
(add-code
  '((function! main [
      (default-space:space-address <- new space:literal 30:literal/capacity)
      (x:string-address <- new
"schedule: main
run: main 0: (((1 integer)) <- ((copy)) ((1 literal)))
run: main 0: 1 => ((1 integer))
mem: ((1 integer)): 1 <= 1
run: main 1: (((2 integer)) <- ((copy)) ((3 literal)))
run: main 1: 3 => ((2 integer))
mem: ((2 integer)): 2 <= 3
run: main 2: (((3 integer)) <- ((add)) ((1 integer)) ((2 integer)))
mem: ((1 integer)) => 1
mem: ((2 integer)) => 3
run: main 2: 4 => ((3 integer))
mem: ((3 integer)): 3 <= 4
schedule:  done with routine")
      (n:integer <- length x:string-address/deref)
      ($print (("p4 " literal)))
      ($print n:integer)
      ($print (("\n" literal)))
      (s:stream-address <- init-stream x:string-address)
      (traces:instruction-trace-address-array-address <- parse-traces s:stream-address)
    ])))
(run 'main)

(reset)
3-09-27 02:08:46 +0200 update todo' href='/ahoang/chawan/commit/todo?id=2d414c2b77acb8c276812d78ff814ccadc33691f'>2d414c2b ^
719ee428 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
            
                                         




                                                                              





                                                                           
                             




                                                                        

                          


                                                                    











                                                                             












                                                                               
                                                       

                                                             
         



                                                     
                                             

                                             


                                                                        
                               
                                  
                                        
                  
              






                                                                               

                                                                          

                                                    


                                                     
        





                                                                          


                                                                                         
             
                                                           
compilation:
- reduce binary size (maybe gzip data/*?)
- improve compilation times (it's sloooow... we could probably speed up the js
  macros somehow, also the html parser/tokenizer?)
charsets:
- set up some fuzzer
- use appropriate charsets in forms, urls, etc.
display:
- important: add a virtual cursor (in some terminals, the real cursor is
  often obscured by white background color)
- important: buffer list
	* either a buffer list buffer, or a buffer list popup menu. ideally
	  both.
- dark mode (basically max Y)
- do not assume default background color
	* instead, add an "override-default-color" option that is set to
	  true by default and replaces default bgcolor/fgcolor with
	  default-background/foreground-color
- allow overriding ansi colors
config:
- important: config editor
- better path handling
	* e.g. expand tilde for all paths on load, allow environment
	  variables/shell substitution, etc.
buffer:
- important: incremental html parsing
	* also, do not needlessly copy in onload
- important: validate returned values
	* do not block container when receiving buffer data; if invalid, kill
	  buffer
	* this also includes not crashing when the buffer dies while
	  container is reading...
- important: add sandboxing
	* also, other security stuff:
		- configurable/better url filtering in loader
		- make peekCursor show the entire url
- when the log buffer crashes, print its contents to stderr
	* make console.err a TeeStream, and tee it to a StringStream that
	  buffers up to 4KB
- add highlighting, copy
- add buffer groups
- add option to write source to a file, instead of keeping it in memory
- hex viewer
- xhtml
- better horizontal line handling: allow viewing content positioned before page
  start, handle long lines, etc
- do not prompt when submitting forms (it's annoying)
	* this is mostly fixed, but not completely
network:
- uBO integration? (or at least implement filter lists)
- websockets (curl supports ws)
- integrate curl-impersonate (LD_PRELOAD works, but still...)
external:
- history, bookmarks (w3m format)
- save buffer (source, output)
- edit buffer (local file, or whatever we downloaded)
javascript:
- important: callbacks should not leak memory
- add support for JS mixins
- distinguish double from unrestricted double
- better dom support, more events
	* more concretely: get jQuery to work. this needs innerHTML, CSS
	  properties in DOM, ...
- implement ReadableStream, XHR
- separate console for each buffer
	* also, do not crash on / -> M-c
- buffer selection
layout engine:
- important: clear (to complete float support)
- fix conflict in renderdocument Y error correction and floats
	* if too many line breaks are done because of floats, Y error
	  correction will happily arrange the lines on top of the floating box
- make table width calculation consistent with FF etc.
	* unfortunately, most websites are designed for auto table layouts
	  where w3m's space distribution algorithm does not work really well :/
- make background-color a property of inline boxes, not words. (this would
  require implementing actual inline boxes)
- table layout: include caption in width calculation
- details element
- overflow
- incremental layout & layout caching
	* first for tree generation, then for layout.
- iframe
- writing-mode, flexbox, grid, ruby, ... (i.e. cool new stuff)
images:
- sixel encoding (eventually also kitty)
- more formats (apng, gif: write own decoders, jpeg: use libjpeg, webp: ?)
- incremental decoding (maybe implement streams first?)
- separate image decoder process? or just run on a different thread?
etc:
- important: replace fastRuneAt with qjs libunicode (fastRuneAt has no error handling...)
- tests (including aforementioned fuzzer)
- orc support
- maybe windows support? (blocker: needs a windows machine)