« first day (18 days earlier)      last day (642 days later) » 

12:10 AM
I've been thinking a bit about how to best approach a GUI toolkit in a functional language like this.
And I think I have something kinda figured out
Basically you have a bunch of functions representing widgets (button, window, etc.)
And what these functions do is they take their options and return some sort of function containing drawing commands
Then you have a scene_draw function written in C or whatever that takes these functions and executes them, drawing the results
For child-parent relations you can just pass more widgets as args
I like this idea because it (potentially) allows for "anonymous" widgets:
\scene_draw(<return <...>>)
The problem is the actual drawing.
The best option as I see it is to make OpenGL Pytek bindings.
Alternatively we could use some kind of string format representing how to draw the widget and have \scene_draw be written in C and call OpenGL
The former appeals to me more because it allows for more control.
 
12:30 AM
One of my goals for the array of built-ins is indeed 2D graphics, so the GUI toolkit could potentially be written in Pytek, which would be pretty cool, I think.
Also, what do you think of the idea of making a way to edit the AST with the GUI?
 
@El'endiaStarman I'm not sure I quite get what you mean
_UNK
 
I ' m not sure I ' m not sure what you mean.
Well, I've been reading the other essays by the guy who wrote Succinctness is Power, and he's a pretty strong advocate for Lisp. One of the reasons, I've figured out, is that with Lisp, you basically write the AST.
I don't really know if being able to directly edit the AST (in the sense that the software automatically generates the corresponding code) will be all that useful, but it's something I'd like to see nonetheless... :P
 
Hmm
 
That's far in the future though. I'm not gonna worry about it now.
I still really need to write a function that prints the AST.
 
@El'endiaStarman If we can get a really good base 2D graphics toolkit building the GUI toolkit on top of that the way I outlined it would be amazing
Anyways, hmm what to do right now
 
12:47 AM
um
 
I still need to do operators...
I'm trying to think of what you can do.
Oh, by the way, I was planning on giving you the ability to git push to a Pytek repo on my website's server.
The idea is that we could use C9 for trying out stuff or direct collaboration, but we would both have the ability to update the official website interface.
Well, in the sense of the Python interpreter backend.
 
k
Hmm
Is there a way to just get a big tarball of the current workspace
I want to try something locally
 
Yep, you can do that.
 
oops stupid internet double posting
 
12:51 AM
File -> Download Project
 
@El'endiaStarman Ah, thanks.
 
I did that myself a couple nights ago, actually. Haven't done anything with it yet, but I know how to get the code.
Another thing I realized several days ago is that I decrement i if a node doesn't use the whole val list, which could be problematic when there are multiple tips that are exploring alternate paths through the AST, so I'm gonna have to restructure the parser ever so slightly for that.
Once I start, though, there's no guarantee that it'll work.
Aaand finished, with all unit tests passing! :D
 
Wow, that was fast.
 
Man, I love it when it's that easy! :D
 
err
It just failed a unit test
:P
I think you forgot to build.
 
12:59 AM
oh
-_-
 
I can change the interpreter path to use the source version instead of the binary.
 
Gimme a moment to make sure it does work.
 
Changed the unit tester so that it doesn't crash with non-zero exit codes (?? subprocess pls)
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/cx_Freeze/initscripts/Console.py", line 27, in <module>
    exec(code, m.__dict__)
  File "../src/pytek_main.py", line 24, in <module>
  File "../src/pytek_parser.py", line 21, in AST_parse
TypeError: list indices must be integers, not str
error in case you were curious
 
I fixed that bug and the next few.
It's not 100% fixed yet though.
 
1:04 AM
Huh, it's ending far too soon.
 
Just out of curiosity, I did a benchmark locally, and suddenly the cx_Freeze version is faster than the Python one. wtf
I blame VM
 
lol ¯\_(ツ)_/¯
 
roflcopter
 
oh, that's why
The parser only loops through the tips once... >_>
...well, that's a weird output.
 
What happened?
 
1:13 AM
Hello world!
,  'Hi!
Hi!"""

' 337 'heyyy
man'
Source code: \print(\"Hello world!\", 'Hi!\"\"\"' 337 'heyyy\nman')
 
uhh
OK, so clearly the args are getting parsed wrong
 
I really really need to write that AST tree function. It'd make this a lot easier to debug, I think.
 
You should really just have a little debug thing that prints out the AST
ninja'd
I don't see an issue with just printing it as-is.
Pretty printing can come later
i.e just iterate through it and replace any nodes with their values, then print
 
I guess there's no better time than now.
I do have a debug setting. It's just that it prints out a LOT of stuff.
Here, do cd src and then python3 pytek_parser.py.
 
OK.
well
You should probably add a verbosity flag then
-v for basic -vv for this
 
1:19 AM
Haha, yeah, but I'm gonna go ahead and do the tree function.
 
1:34 AM
TypeError: object of type 'filter' has no len() - one stupid error that won't be in Pytek.
 
2:09 AM
Okay, I got that working. Gonna add a flag to pytek_main for it.
 
2:21 AM
Okay, that's working too. -t for running the program as normal and then printing the AST afterwards, and -T for only printing the AST.
elendiastarman:~/workspace/src $ python3 pytek_main.py -c "\print('Hello world!')"
bash: !': event not found
@Doorknob HALP
 
2:35 AM
escape it?
 
in The Nineteenth Byte, 2 mins ago, by El'endia Starman
Using a backslash doesn't work either because apparently bash leaves it in...
in The Nineteenth Byte, 1 min ago, by El'endia Starman
(A \ must be followed by a function name, and ! is not a valid function name, so...)
 
single quotes
 
Another way: do set +H to turn off history expansion. I never use that, so no big deal for me.
 
single quotes surrounding the code string will prevent history expansion
I use history expansion a lot because I'm lazy af
 
2:40 AM
So the tree printing works?
 
yup! :D
 
cool
 
Next: figure out why everything after a string is stringified.
 
 
7 hours later…
9:38 AM
PARSER FIXED!
Oh, also, there's now a -d flag that turns on debug (which has a delay of 0.1 seconds to make it easier to Ctrl+C it).
elendiastarman:~/workspace/src $ python3 pytek_main.py -c "\print('Hello world!' \add(\factorial(\add(2,3)),\factorial(5)) 'blah!')" -t
Hello world!
240
blah!
┬root
└┬\print
 └┬funcArgs
  ├string: Hello world!
  ├┬\add
  │└┬funcArgs
  │ ├┬\factorial
  │ │└┬funcArgs
  │ │ └┬\add
  │ │  └┬funcArgs
  │ │   ├number: 2
  │ │   └number: 3
  │ └┬\factorial
  │  └┬funcArgs
  │   └number: 5
  └string: blah!
Beautiful!
It occurs to me that I could actually probably write a transpiler to Lisp or something from this AST.
 
Anonymous
+1 for box drawing diagrams
 
Anonymous
cp437 > all except utf8 I guess
 
haha, yeah
I actually used your tool to get the characters I wanted. :D
 
Anonymous
:D
 
I need to start keeping a list of people who have contributed in any way.
 
Anonymous
9:51 AM
It would be really handy for writing Seriously code if the commands.txt wasn't infinitely more convenient
 
Anonymous
I can't ever remember what byte does what operation
 
Anonymous
Which is why I'm absolutely making an assembly language for Seriously
 
Maybe you can add a little tool that converts mnemonics into those byte values. ...which is what your idea is, I guess.
 
Anonymous
Yep
 
9:54 AM
Alright, well, I need to go to bed before I start working on operators and end up staying up another hour.
 
Anonymous
I also need to go to bed before I invent a time machine to punch my past self in the face
 
Anonymous
in The Nineteenth Byte, 5 mins ago, by Mego
I really want to go back in time 3 months and punch myself in the face for writing code I knew would be incompatible with Python 3 when it's literally 0 effort to make it compatible
 
hahaha
Yeah, I saw that. :P
 
Anonymous
Stupid me... Why did I use type(a) is SomeType when it's literally 0 more effort to just do isinstance(a, type)
 
Anonymous
Now I get to go through and change all those
 
9:56 AM
A bit of vim magic would probably be useful there.
Too bad you're not Doorknob. :P
 
Anonymous
Maybe
 
Anonymous
Or maybe just a regex
 
yeah, pretty much
 
Anonymous
Ẉ̷̭̠̰͚̖ͩ̋ͧ͂h̿̽͐ͪ͂̓a̳̥̬͚ͦ̇͌̀ẗ̶̟̳͇͍̭̜̫́̓̏ͩͪ ̬͗ͪ̇͝cͥ̐̑̄̿̓͏̳͔̰̫͎̺o͖̻̦̜̮͆̊̃ͩͮ̚ͅu̘͙̼̳̭̣ͨ͋̽̇̀͢l͔̣͇̪̦̦̲̔ͭͯͭ̎̅͋̀ḓ̙̒͗̅ͩ͡ ̭̺̥̥̙̹̦ͭ͗̎ͥͮ͗̆p̲̼̦̟̝̪̅ͧ̓͐ͤ̑̄o͎̠̠̐̚s͖̼̳ͯͫ͑ͨͪ̀s̩͙͖ͣ̿̇̂̇̌̕i͍̬̟̥͌͒̄ͩ̆̇̾̀b̹͈͋̑l̓̌̊͌̆ͮ‌​̰͍̕y̶̫̗̯̮̭̟͇̓̊̎̔͛̃ ̛̗͚͙͎̥͑͋̆̏̇̓̋g̿͑̈́ͫ͌͏̙͎̗͚͙̩ͅo̰̬͕̓̓͛ͪ̏̃ͥ ̭͇̯͇̠̚͡w̟ͯͮ̅͒̍̒r̴͈̠̮̦̫̫͌͑͋̂ͩo̷͕̳͕̺̊͐n̜̹̭̫̎̈̿ͦ̓͛͌͘g͎̗̗̖̼ͭ̑͊̀͝ͅ?͎ͬ̍̍̈ͫͦ
 
Anonymous
9:58 AM
if type(a) is StringType or isinstance(a,SeriousFunction):
 
Anonymous
What is this horseshit, past self?
 
bahaha
That's........impressive. :P
Okay, g'night!
 
 
10 hours later…
8:23 PM
Hallo, what have I missed?
 
PRETTY AST TREE!
 
No I saw that
very pretty +1
 
I'll implement operators today. I've been thinking about how exactly to do it, coding in my head basically.
 
Cool, cool.
I've been thinking about what the standard library will be like.
I think unlike Python I don't want to split everything up into modules.
I'd rather have the most common things built-in and the more esoteric in modules.
 
I was thinking much the same. Just make everything built-in (within reason).
 
8:29 PM
That's what Perl does
I also definitely think a preprocessor would be cool.
@define, @include, etc.
 
What's the advantage of a preprocessor?
 
@El'endiaStarman #define is a really cool tool in C since it allows you to alias certain syntactical structures that can't be put in functions
 
I've also seen it...well....abused...
 
#if is also awesome because it happens before compiling (or in our case interpreting) so you can take out certain sections of code depending on the environment
@El'endiaStarman Well, that's a risk in all languages
 
haha, indeed
 
8:32 PM
Surely you've seen OOP abused before :P
Finally I'd also love to see an @includec for C headers.
That'll be very hard.
 
I've been thinking on providing a --safe flag of some kind that prevents eval, including unknown code, etc...
 
Absolutely.
Actually, by default in Perl 6 eval can't be used period. You have to add a special command line argument in order to use it
 
oh cool
 
Oh, it's not a command line argument.
It's a pragma
use MONKEY-SEE-NO-EVAL
lol
 
haha
@AquaTart Could we do @includepy too?
 
8:43 PM
Probably.
Might be a little trickier because of objects.
 
9:03 PM
I don't understand C9's terminal. I lose everything I've done in terms of output and command history.
Maybe it's because I hibernate my computer without, uh, detaching the terminal or something.
 
9:18 PM
Added a \printAST function! :D
 
I did some "research" and I think I know how to handle scope
Python apparently just does a list of hashes. Easier than I thought :P
 
lol, okay
 

« first day (18 days earlier)      last day (642 days later) »