Loading ...
Sorry, an error occurred while loading the content.

OT: Preview of something I've been working on

Expand Messages
  • thad_floryan
    I m always playing with something new (at least something new that makes sense to me :-). I thought you might get a kick out of seeing something that s
    Message 1 of 1 , Jun 25, 2011
    View Source
    • 0 Attachment
      I'm always playing with something new (at least "something new" that
      makes sense to me :-). I thought you might get a "kick" out of seeing
      something that's 100% portable across the (at least 50+) platforms I've
      already tested; it generates machine independent code that's very fast,
      it has an interactive language (for which the code is generated and
      executed), it has a full programming language that can link to anything
      on a system, and it's a full DBMS.

      Below is a short sample session at its CLI prompt; the "ena prtcd" (for
      enable printcode) generates code which sets a flag to display/append the
      code generated for each command to a file for my debugging purposes.

      $ ls *.c | wc -l ; ls *.h | wc -l; ls *.min | wc -l
      190 "c" files
      75 "h" files
      5 machine-independent files
      $ du .
      35138 35MB for source, objects and executables

      Here's the short interactive session:

      *ena prtcd

      *ty 1+2+3+4, 2s, @pi,2s,@e
      10 3.1415927 2.7182818

      *ty @date,2s, @date+23 days
      06/25/11 07/18/2011

      *ty @date +2 days - 3 years
      06/27/2008

      *ty @date,2s, @date + 100000 seconds
      06/25/11 06/26/2011

      *ty @sqrt 123,2s,@log2 123,2s,@log 123
      11.090537 6.9425145 2.0899051

      *ty @uc"t" + @substr("abcdefghij",8,1) + @lc("A") + @chr 100
      Thad

      *ty \o17,2s,\h1F,2s, 3 band 7, 2s, 1blsh 3
      15 31 3 8

      and here's the generated code for 2 of the above examples (noting code
      optimation has NOT been enabled):

      Direct statement GENERATED CODE DUMP: Sat Jun 25 17:57:23 2011
      For @... = [ty 1+2+3+4, 2s, @pi,2s,@e]

      Header Information

      000000 148 CPsfix, codoff to string fixup chain
      000004 0 CP.CPxxxx (not used)

      Generated Code

      000008 LIRC 0,=1 (=0x1)
      000016 ADDIRC 0,=2 (=0x2)
      000024 ADDIRC 0,=3 (=0x3)
      000032 ADDIRC 0,=4 (=0x4)
      000040 TYPEIV 0,+88 (codoff=132 (0x84))
      000048 LSRO 0,+96 (codoff=148 (0x94))
      000056 TYPESV 0,+76 (codoff=136 (0x88))
      000064 LNRO 0,+116 (codoff=184 (0xb8))
      000072 TYPENV 0,+64 (codoff=140 (0x8c))
      000080 LSRO 0,+64 (codoff=148 (0x94))
      000088 TYPESV 0,+44 (codoff=136 (0x88))
      000096 LNRO 0,+76 (codoff=176 (0xb0))
      000104 TYPENV 0,+32 (codoff=140 (0x8c))
      000112 LSRO 0,+44 (codoff=160 (0xa0))
      000120 TYPESV 0,+20 (codoff=144 (0x90))
      000128 RET

      Encoded Formats: 4

      000132 0x00000000 (freeform)
      000136 0x00000001 (str data length)
      000140 0x00000000 (freeform)
      000144 0x00010000 (FNiow=1)

      Strings: 2

      000148 SDptr=156
      000152 SDlen=2, SDnext=12 (codoff=160)
      000156 " "
      000160 SDptr=168
      000164 SDlen=1, SDnext=0
      000168 "\012"

      Intrinsic Constants: 2

      000176 2.718282
      000184 3.141593

      and

      Direct statement GENERATED CODE DUMP: Sat Jun 25 17:59:33 2011
      For @... = [ty @uc"t" + @substr("abcdefghij",8,1) + @lc"A" + @chr 100]

      Header Information

      000000 176 CPsfix, codoff to string fixup chain
      000004 0 CP.CPxxxx (not used)

      Generated Code

      000008 LSRO 0,+164 (codoff=176 (0xb0))
      000016 RUC 0,
      000020 SSRO 0,+208 (codoff=232 (0xe8))
      000028 ARGPTR +156 (codoff=188 (0xbc))
      000036 ARGPTR +128 (codoff=168 (0xa8))
      000044 ARGPTR +124 (codoff=172 (0xac))
      000052 SUBST3 0,
      000056 LSRO 1,+172 (codoff=232 (0xe8))
      000064 ADDSTRR 1,0
      000068 SSRO 1,+160 (codoff=232 (0xe8))
      000076 LSRO 1,+128 (codoff=208 (0xd0))
      000084 RLC 1,
      000088 LSRO 0,+140 (codoff=232 (0xe8))
      000096 ADDSTRR 0,1
      000100 SSRO 0,+128 (codoff=232 (0xe8))
      000108 LIRC 0,=100 (=0x64)
      000116 CHRR 0,
      000120 LSRO 1,+108 (codoff=232 (0xe8))
      000128 ADDSTRR 1,0
      000132 TYPESV 1,+24 (codoff=160 (0xa0))
      000140 LSRO 1,+76 (codoff=220 (0xdc))
      000148 TYPESV 1,+12 (codoff=164 (0xa4))
      000156 RET

      Encoded Formats: 2

      000160 0x00000000 (freeform)
      000164 0x00010000 (FNiow=1)

      Integers: 2

      000168 8 = 0x00000008
      000172 1 = 0x00000001

      Strings: 4

      000176 SDptr=184
      000180 SDlen=1, SDnext=12 (codoff=188)
      000184 "t"
      000188 SDptr=196
      000192 SDlen=10, SDnext=20 (codoff=208)
      000196 "abcdefghij"
      000208 SDptr=216
      000212 SDlen=1, SDnext=12 (codoff=220)
      000216 "A"
      000220 SDptr=228
      000224 SDlen=1, SDnext=0
      000228 "\012"

      Temporary Work Areas: 1

      000232 BLOCK 8 bytes

      000240 END

      Direct statement GENERATED CODE DUMP: Sat Jun 25 18:00:47 2011
      For @... = [ty \o17,2s,\h1F,2s, 3 band 7, 2s, 1blsh 3]

      Header Information

      000000 168 CPsfix, codoff to string fixup chain
      000004 0 CP.CPxxxx (not used)

      Generated Code

      000008 LIRC 0,=15 (=0xf)
      000016 TYPEIV 0,+136 (codoff=156 (0x9c))
      000024 LSRO 0,+140 (codoff=168 (0xa8))
      000032 TYPESV 0,+124 (codoff=160 (0xa0))
      000040 LIRC 0,=31 (=0x1f)
      000048 TYPEIV 0,+104 (codoff=156 (0x9c))
      000056 LSRO 0,+108 (codoff=168 (0xa8))
      000064 TYPESV 0,+92 (codoff=160 (0xa0))
      000072 LIRC 0,=3 (=0x3)
      000080 BANDIRC 0,=7 (=0x7)
      000088 TYPEIV 0,+64 (codoff=156 (0x9c))
      000096 LSRO 0,+68 (codoff=168 (0xa8))
      000104 TYPESV 0,+52 (codoff=160 (0xa0))
      000112 LIRC 0,=1 (=0x1)
      000120 BLSHIRC 0,=3 (=0x3)
      000128 TYPEIV 0,+24 (codoff=156 (0x9c))
      000136 LSRO 0,+40 (codoff=180 (0xb4))
      000144 TYPESV 0,+16 (codoff=164 (0xa4))
      000152 RET

      Encoded Formats: 3

      000156 0x00000000 (freeform)
      000160 0x00000001 (str data length)
      000164 0x00010000 (FNiow=1)

      Strings: 2

      000168 SDptr=176
      000172 SDlen=2, SDnext=12 (codoff=180)
      000176 " "
      000180 SDptr=188
      000184 SDlen=1, SDnext=0
      000188 "\012"

      000192 END
    Your message has been successfully submitted and would be delivered to recipients shortly.