These are chat archives for miketheprogrammer/go-thrust

14th
Nov 2014
William McGann
@tehbilly
Nov 14 2014 15:06
Fancy timing on that! I just happened to see the notification on github before I stepped out for a vape.
Gotta say, I'm pretty excited about go and thrust. Thinking of porting over a node-webkit app I did to see how it compares.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:14
Shit tehbilly you vape
i got my fu chai mod right here with a sigelli s
One of the major things i will need alot of help on is maybe creating a standard library, of JS => Go for quick prototyping of applications
Node-Webkit has the benefit of exposing Node's stl, we need something similar
William McGann
@tehbilly
Nov 14 2014 15:17
I haven't worked with thrust at all, I've only been looking over this repository. I'm a gopher primarily, I do UI stuff very seldom.
But the possibility to do so is nice.
And yeah, I'm a builder/vapist. :D Vaping on my beater box right now, 60 watt yihi chip, oldschool and don't care.
On my local clone I've already done some restructuring to make things more idiomatic, not making any huge time effort since I am currently at work.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:18
nice, i want one of those 100 watt'ers, i got my coil at about .37 right now
William McGann
@tehbilly
Nov 14 2014 15:19
But make it a bit easier to work with from a go dev's point of view.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:19
im at work also, and have a big project im switching between.
William McGann
@tehbilly
Nov 14 2014 15:19
.37 would be perfect on my 120 watt raptor box. Powered from an ac/dc led driver. :D
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:19
my hope is to help our QA team by using thrust to run automated tests.
William McGann
@tehbilly
Nov 14 2014 15:19
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:20
omg thats insane
William McGann
@tehbilly
Nov 14 2014 15:20
I can absolutely see that being awesome. I've used a node-webkit version of my serverside apps here to get people to bypass their IE8 installs and locked down laptops. <_<
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:20
im merging a pr i just did that has an example of a chat client/server
William McGann
@tehbilly
Nov 14 2014 15:20
Have you seen the exposed interface for http://godoc.org/github.com/lonnc/golang-nw ?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:21
yea, uggh i work in a client based company at ie <9 is our nightmare
William McGann
@tehbilly
Nov 14 2014 15:21
We're still at ~60% saturation on IE8. Financial institution, pretty big one. Internal apps written years ago with ancient ActiveX crap.
Ok, outside to vape. Our lockdown is why I have trouble getting to IRC reliably. :(
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:23
golang-nw looks awesome, but scares the effin shit out of me
tehbilly there are loads of cloud irc providers
William McGann
@tehbilly
Nov 14 2014 15:32
Yeah, believe me I know. You underestimate our security here. :p
Not just a financial institution, also house medical records. I've worked on government projects that were more lax
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:37
ah, damn, thats unfortunate.
William McGann
@tehbilly
Nov 14 2014 15:39
Yep, a constant pain. Anyways, the way golang nw exposes a small, very configurable interface is just delightful. In my cloned version of this repo I am moving common package to the root, which makes it go get capable and easier to import
One import line by default.
Also, how do you feel about having the fetch portion of the library something you leave up to the developer? That's the one thing so far that's struck me as "eh"
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:43
that struck everyone in #go-nuts as "eh"
the thing is @spolu wanted a similar experience across all the *-thrust libraries.
I think that at a minimum the autobootstrap should be seperated out, anyone that actually packages an application with go-thrust can package the necessary binaries in the install
so, boostrap should not be executed by spawn
maybe it should actually be a bin file
bin/boostrap.go
William McGann
@tehbilly
Nov 14 2014 15:49
Very nice looking! I think to be go idiomatic and still provide the same experience you can make a spawn/launch package with a struct for the process that contains a download policy. On by default, or configurable, or provide your own you can pass in that satisfies the interface. Like the net/http package, where you can provide your own client or policies
lorddoig
@lorddoig
Nov 14 2014 15:51
3 gophers and 3 vapers, there's a psychology study in this somewhere
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:53
haha, it means we love simplicity
William McGann
@tehbilly
Nov 14 2014 15:53
We like technology! Be right back, starting /r/coilsandcode
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:53
where cigarettes are like the c++ stl
vapor liquid is more like the go stl
:smile: coilsandcode
lorddoig
@lorddoig
Nov 14 2014 15:55
ha! you guys are talking model numbers and stuff, I've been using the standard thin battery/ce4 combo for 2 years - am I making a mistake?
William McGann
@tehbilly
Nov 14 2014 15:57
Not if it's working for you.
My girlfriend is using the eleaf istick and a kayfun and happy with it.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 15:58
yea, its whatever works for you. Not everyone needs to be crazy blowing their faces off with sub ohm high watt setups
man, maybe i should rethink my life choices
lorddoig
@lorddoig
Nov 14 2014 15:59
I've never tried anything else. I take it the occasional metal taste and accidental liquid nicotine burns to the lips are standard across the board?
It's an experience I wish was more reliable, for sure
William McGann
@tehbilly
Nov 14 2014 16:00
Liquid burns/ Yes. Metal taste? Not really
http://imgur.com/ANxnfh6 But you can't say no to this arr arr arr
lorddoig
@lorddoig
Nov 14 2014 16:00
wtf is that?
William McGann
@tehbilly
Nov 14 2014 16:01
SCIENCE
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:01
lol @lorddoig , that is a dual coil build
William McGann
@tehbilly
Nov 14 2014 16:02
Was a test on a new coil I did. Does pretty well, but took forever.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:02
possibly sub-ohm, meaning if your ce4 is at 2.0 ohms, that coil is probably at <.5
lorddoig
@lorddoig
Nov 14 2014 16:02
man there's a whole world out there I never knew
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:02
meaning tehbilly's throat burns life fire every time he takes a hit, jkjk
William McGann
@tehbilly
Nov 14 2014 16:02
Don't go down the rabbit hole, man. It's like code, but worse, because it can literally burn you.
lorddoig
@lorddoig
Nov 14 2014 16:03
haha
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:03
yea, i agree
but it also cost much less then replacing tanks and attys all the time
William McGann
@tehbilly
Nov 14 2014 16:03
Actually that coil was about .5 exactly. Driving 6 volts through it, and a surprisingly cool vape.
That is true, as long as you don't start collecting/building. Because then your cost savings go out the window.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:03
yep, that happened to me at the beginning
but now i can last 6 months on cotton balls from CVS lol
i spend most of my money now on luxury juices
William McGann
@tehbilly
Nov 14 2014 16:05
One of my old friends runs steam punk vapors, and even at full prices his juices are very reasonable. $25 for 120ml
lorddoig
@lorddoig
Nov 14 2014 16:05
My big cost is juice
William McGann
@tehbilly
Nov 14 2014 16:05
But yeah, if you get into just rebuilding coils and a simple dripper, you can get a VERY satisfying vape experience that's cheap to mantain.
lorddoig
@lorddoig
Nov 14 2014 16:05
I only like one kind and it's crazy expensive
William McGann
@tehbilly
Nov 14 2014 16:06
What kind is it?
I've tracked down the manufacturer and am trying to figure out how to approach them to get them to make "something similar" in a 5 gallon drum
that shit is £14.50 + a minimum of £3 postage for 30ml!
William McGann
@tehbilly
Nov 14 2014 16:11
Oooh, you're across the pond. That's definitely a juice I've never had.
lorddoig
@lorddoig
Nov 14 2014 16:11
Yes indeed, greetings from Britain.
William McGann
@tehbilly
Nov 14 2014 16:12
A lot of my very first development coworkers were from there. Leeds, I believe.
lorddoig
@lorddoig
Nov 14 2014 16:12
Most folk say it tastes of nothing
William McGann
@tehbilly
Nov 14 2014 16:12
And I dated a girl from Wolverhampton
Love you silly brits
Having all sorts of lovely problems getting even the simplest demo to run. Basic window demo. Because of our proxy.
lorddoig
@lorddoig
Nov 14 2014 16:15
My best mate is in Leeds now for a conference. He called me at 2am to say he was hiding in the bin shed because he'd accidentally led on a female client at the bar who was waiting for him in reception. Together we figured out how crack a combo lock and got in the staff entrance.
William McGann
@tehbilly
Nov 14 2014 16:15
Modifying the download function directly to get around it. Another reason having it separated out would be handy, for me. ha
lol, nice. Much easier than just going through with it.
lorddoig
@lorddoig
Nov 14 2014 16:16
It was in the end! Anyway, talk about digressing
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:17
Yes, theres an issue now to seperate it out
im working on rewriting the loops so that the system idles more
William McGann
@tehbilly
Nov 14 2014 16:17
Woo, might have to contribute to that directly first, then.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:17
sounds good
lorddoig
@lorddoig
Nov 14 2014 16:18
I'm having real trouble working on this. My brain is uber-coupled to IntelliJ (a mistake, yes) and I can't make it work without ripping the project structure to pieces.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:18
@tehbilly i think it would be good a a binary file
as a *
William McGann
@tehbilly
Nov 14 2014 16:18
Yeah, don't worry about things at idle. The go runtime is surprisingly good at managing it for you.
@lorddoig I'd be happy to help you migrate, if you'd like. I'm a big fan of JetBrains in general, but for go sublime + gosublime + installing from source + gox is much simpler than you'd think.
What platform are you on?
lorddoig
@lorddoig
Nov 14 2014 16:19
osx
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:20
@tehbilly something like gothrust bootstrap ./mydownloaddirectory
William McGann
@tehbilly
Nov 14 2014 16:21
Hrm, you're talking about a separate tool from just handling it programatically.
I was thinking an interface, like ThrustFetcher, that has a couple of methods defined for retrieving the package and returning the location of it.
And the default implementation would work precisely as it does now. Fetch, extract.
I'll mock up something in a bit, if I have time.
I'm not going to actually DO a lot until I get a working example and play around with what's there.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:24
whatever you think is best :). Interface would be good, im open to anything you want to do
William McGann
@tehbilly
Nov 14 2014 16:25
Oh how I wish I heard that more. Can you talk to my girlfriend?
lorddoig
@lorddoig
Nov 14 2014 16:25
@tehbilly it's a tricky thing, i've tried before. I speak vim, but I speak my own bashed together dialect of intellij-vim much better.
ha
William McGann
@tehbilly
Nov 14 2014 16:26
The intellij-vim plugin is nice, but different enough (like all vim plugins are!) that I just don't even bother it.
I go "when in rome" and cuss a lot
lorddoig
@lorddoig
Nov 14 2014 16:27
That's the problem - my productivity is directly tied to all the quirks of my set up. It really was a mistake to drive it home for 2 years.
William McGann
@tehbilly
Nov 14 2014 16:27
Basically, install sublime (3!), install package control, restart, use package control to install gosublime.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:28
yup, and dont worry about too many hotkeys for now, just understand the super+t and super+p interfaces
lorddoig
@lorddoig
Nov 14 2014 16:29
Yeah I've done that, autocomplete won't work no matter what.
William McGann
@tehbilly
Nov 14 2014 16:29
I wish everything had a command palette
Hrm
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:29
autocomplete requires some extra nasty setup
you have to provide your GOPATH and GOROOT to gosublime
i can send you an example of my config
lorddoig
@lorddoig
Nov 14 2014 16:29
Did all that too.
William McGann
@tehbilly
Nov 14 2014 16:29
Installing gocode ain't that bad, really. and I have GOPATH set up externally and nothing else.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:30
oh, there was one more thing i think i did to get it working
lorddoig
@lorddoig
Nov 14 2014 16:31
I have gocode and a correct path setup. No dice. Nuked ~/Library/Application Support/Sublime Text 3 and started again. No dice!
William McGann
@tehbilly
Nov 14 2014 16:31
If you're at the terminal and type gocode -h what do you get?
Mine was wonky
lorddoig
@lorddoig
Nov 14 2014 16:31
the usage
William McGann
@tehbilly
Nov 14 2014 16:31
So I installed it separately via go get
Then again, i ain't on no stinkin' osx box
lorddoig
@lorddoig
Nov 14 2014 16:32
*nix?
William McGann
@tehbilly
Nov 14 2014 16:32
(No hate, just jealous, our apple hardware here isn't as powerful as our lenovo hardware)
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:32
ugh osx i hate it
William McGann
@tehbilly
Nov 14 2014 16:32
At home, yes.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:32
im on osx
William McGann
@tehbilly
Nov 14 2014 16:33
I'd use osx just for the proper damn terminal
cygwin is.. usable, but barely.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:33
ohhhhh your using windows, ughh
lorddoig
@lorddoig
Nov 14 2014 16:33
@miketheprogrammer how come?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:33
work gave me an osx comp
lorddoig
@lorddoig
Nov 14 2014 16:33
I second that ughh
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:33
didnt feel like reinstalling linux on it
William McGann
@tehbilly
Nov 14 2014 16:33
Next time I have to swap hardware I'm getting one of the new macbook pros, since they have the ssd version here finally.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:34
@lorddoig in your config is // Whether or not gscomplete(gocode) is enabled
"gscomplete_enabled": true,
also try deleting $GOPATH/pkg as long as your GOPAth is not your root
lorddoig
@lorddoig
Nov 14 2014 16:35
I was impressed when I bought my first SSD, but the difference didn't really hit home til I spent two hours trying to find a phantom process on a mate's brand new macbook that was making it crawl...until I realised it was the spinning disk.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:35
margo uses $GOPATH/pkg to store autocomplete, so every so often when you change your code, for some reason you have to delete that directory
its lame
i would actually suggest only deleting the pkg/github.com/{user}/{packageyourworkingon} directory
lorddoig
@lorddoig
Nov 14 2014 16:37
@miketheprogrammer that's fixed it!
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:37
:)
lorddoig
@lorddoig
Nov 14 2014 16:37
thank you!
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:37
you might have to keep doing that, it sucks but yea.
William McGann
@tehbilly
Nov 14 2014 16:37
Ah, yes, the pkg issue. I haven't had that problem in awhile.
I aggressively clear that out, though. I only leave $GOPATH/bin alone.
lorddoig
@lorddoig
Nov 14 2014 16:38
It anything going to blow up by rm -fing $GOPATH/pkg regularly?
William McGann
@tehbilly
Nov 14 2014 16:38
Go will recreate it.
lorddoig
@lorddoig
Nov 14 2014 16:38
I thought so. Excellent.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:38
just dont blow away /src
lol
William McGann
@tehbilly
Nov 14 2014 16:41
Yeah, now THAT directory I totally need to clean up.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:41
yea
William McGann
@tehbilly
Nov 14 2014 16:42
On this laptop it's almost a year old.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:42
Activity monitor on osx is not showing any idle wakeups for go-thrust
until i do something
which is good
William McGann
@tehbilly
Nov 14 2014 16:43
99 users, ~580MB
Took out all of your sleeps?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:43
what is 99 users? and yes a fair amount of them
William McGann
@tehbilly
Nov 14 2014 16:44
Like $GOPATH/src/github.com/{user}
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:44
oh
hah yep
William McGann
@tehbilly
Nov 14 2014 16:45
Yeah, time.Sleep() is evil. Evil evil evil.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:45
theres one function in menu, i really want to optimize
the first Goroutine in menu.SendThread needs to be improved i think
William McGann
@tehbilly
Nov 14 2014 16:45
Reminds me of a java "daemon" I got to kill a few years ago. What kept it a daemon? "for ;; { doNothing(); }"
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:46
the second one uses channels, so its good
William McGann
@tehbilly
Nov 14 2014 16:46
Let's see here.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:46
the first one essentially signals the second one
William McGann
@tehbilly
Nov 14 2014 16:47
I see, line 209
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:47
this could be fixed by each node in the tree emitting its sync events up the hierarchy, but im not sure.
yea, line 209
William McGann
@tehbilly
Nov 14 2014 16:48
I would do that, yes. Send to a channel to notify that it's ready. That, or use (nooo!) mutexes.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:49
most of the states are simple to rewrite, except for childstable
that will need a bubbling up of states
William McGann
@tehbilly
Nov 14 2014 16:49
It's turtles all the way down.
Bubbling is completely awful to logic out. I'd create an issue to track that one, I'd want to get more familiar with the syncs needed before touching it.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:51
I would ideally love to simplify the menu as much as possible
William McGann
@tehbilly
Nov 14 2014 16:51
Oh, a question I thought of last night while I was browsing your repo from bed on my phone, I notice that there were many unbuffered channels for sending and receiving data to thrust
Like for menu.Sync.Ready that's fine, because you want that sync point.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:52
i am terribly new to GoLang, this is my first major project. Can you enlighten me as to why i would use a buffered channel to send and receive data
William McGann
@tehbilly
Nov 14 2014 16:52
Ah, here we go. connection.InitializeThreads()
So you're queueing up commands to send to thrust, and a place to process responses, amirite?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:53
Yes
William McGann
@tehbilly
Nov 14 2014 16:53
An unbuffered channel blocks on send AND receive unless there's someone on both ends, and it's a non-deterministic order about which goroutine will get it.
If you use a buffered channel, it's like a message queue. A fifo one, etc.
It won't block a sender until it's full.
And the order is maintained, which I believe would be good for this use case.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:54
oh, wow, i did not even know that, I though sending was non blocking
William McGann
@tehbilly
Nov 14 2014 16:54
Only on unbuffered channels. I, for one, like the fact that they're usable both ways.
Computationally it's less overhead for short-term channels. Like you want to be notified of an event (like you're using for the downloader output: https://gist.github.com/tehbilly/13af75040e5521026da0)
Michael Hernandez
@miketheprogrammer
Nov 14 2014 16:55
basically, go-thrust makes an asynchronous library look synchronous by maintaining states. In Thrust you cannot maximize a window before you show it, however, go-thrust will only execute the maximize command after show has been successfully called
thats why there is such crazy state manipulation
so commands are queued, and not guaranteed to be executed at the current state of the system
William McGann
@tehbilly
Nov 14 2014 16:57
I gotcha. Sounds like a simple FSM might be in order. In go, the idiomatic way to handle that would be (in my opinion) to have Maximize() return an error type, either nil (no error) or something like WindowNotExist error type.
I also generally will use an (unbuffered) channel for responses if I care to make sure it completed successfully.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:00
in your previous mention of returning an error, none of the current simple code would work
window.NewWindow() would have to block until we received a message from thrust core with the established window id
should i do blocking?
William McGann
@tehbilly
Nov 14 2014 17:02
Sounds complex, and I'm still thinking over the best way to mimic Thrust's stuff in idiomatic
Boss walked by
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:02
lol, I walked by a coworker a few weeks ago and saw him minimize pornhub
William McGann
@tehbilly
Nov 14 2014 17:02
You can ignore return types
Oh lawd, that would never fly here. :/ I hate the larger company feel, but I love my team and projects.
I would say that you should make every method blocking by default.
In go it's easy to make a blocking call just run in a new goroutine if they don't want to wait.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:04
yea but the dependency graph
William McGann
@tehbilly
Nov 14 2014 17:04
Like Maximize() could just block until the window is shown.
Or return an error after a timeout.
It's hard to balance simplicity and control.
And I'm just thinking out loud, by the way. Don't want to sound preachy.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:05
I can prototype a PR and have you review it
I just want to try to create the best experience for Gophers
William McGann
@tehbilly
Nov 14 2014 17:05
And we want a good experience!
That's why we're using go in the first place :D
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:06
yup
William McGann
@tehbilly
Nov 14 2014 17:06
I need to learn more about how thrust works, and interacting with it from another process.
So how familiar are you with Thrust in general, and what can ya tell me?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:11
Ok so heres the breakdown, Thrust essentially exposes itself over JSONRpc, for instance if you want to create a window, a pseudo command is {action_id:1, type:"window", action:"create" }
actionid is an autoincrementing id you need to differentiate your different messages
it will response in kind with a CommandResponse object. this CommandResponse object will contain the TargetID of the new window, and now all subsequent Commands you make should include that targetid
to invoke an rpc method on that target object, you can do an action of type "call" this will call the method in _method with the arguments _args
{target_id:1, action_id:2, action:"call", method:"show", args: { } }
William McGann
@tehbilly
Nov 14 2014 17:13
Hrm, but you're communicating using the spawned process' stdin/out fds
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:13
yes
sending JSONRpc messages over stdin stdout
William McGann
@tehbilly
Nov 14 2014 17:14
Gotcha. Is that the only communication endpoint it supports?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:14
for now yes, we original wrote it with unix sockets but portability was a concern
network sockets might raise some security concerns
William McGann
@tehbilly
Nov 14 2014 17:16
Hrm.
Shame it's not written in go, because there's a nice platform neutral abstraction over those. NamedPipes() in windows works pretty identically to sockets.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:17
yea, that would have been nice, unfortunately compiling the chromium content lib with go is difficult
the best gophers have done so far is the chromium embedded framework
which is less performant
By the way Thrust is going to be used to build the next iteration of the http://breach.cc webbrowser
William McGann
@tehbilly
Nov 14 2014 17:18
Yeah, I'd try it out, but windows :P
I saw the announcement way back.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:18
yea, hence why we wrote thrust
there was too many problems with the original implementations
William McGann
@tehbilly
Nov 14 2014 17:19
At least you didn't give up, and didn't marry it whole-hog too early.
I have zero problems with projects that identify issues and solutions early on.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:19
Never, thats the worst fail of any startup / open source project
William McGann
@tehbilly
Nov 14 2014 17:21
So let's see here.
Your reader and writer receive and send json-encoded commands over stdin/out on the child process.
You're just marshalling and unmarshalling the json via the encoding/json package, and sending them back and forth.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:23
yep
William McGann
@tehbilly
Nov 14 2014 17:23
And maintaining the synchronous requirements manually.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:23
then it is the dispatchers job to dispatch roundrobin to all receivers
each received checks if the message sounds like its for them
if it is, the further delegate it to one of their many handle functions
HandleEvent HandleReply HandleInvoke
reader => dispatcher => registeredreceivers => HandleResponse => Handlers
William McGann
@tehbilly
Nov 14 2014 17:25
Gotcha.
Looking at thrust for event types.
So Window has the majority of events.
Webview has several s well.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:27
Yes, we need to add some events there
Webview is purely frontend
William McGann
@tehbilly
Nov 14 2014 17:28
H'okay, that's good.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:28
Window/Menu/Session are the main backend bindings
Session is wierd
it has a HandleInvoke
this allows thrust core to invoke methods from our code
There is a SessionInvokable interface that allows you to create your own custom session manager
William McGann
@tehbilly
Nov 14 2014 17:29
But that's definitely not something that's dire to expose up front.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:29
P.S. Menu only works on OSX/Linux(unity) systems. Its just for the global application menu, any real application menus should probably be created in javascript
William McGann
@tehbilly
Nov 14 2014 17:30
How would you feel about the handler registry being namespaced?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:30
you mean like dispatcher.RegisterHanlder("window", mywindow.DispatchResponse)
William McGann
@tehbilly
Nov 14 2014 17:31
var registry map[string][]EventHandler or whatever
dispatcher.RegisterClosedHandler(myHandler)
Register or "Add"
I like Add if you're using a slice of handlers.
And you could put it on the top level package, so thrust.AddClosedHandler(myHandler) which internally uses thrust/dispatcher to add 'em
which would be ```
Damnit, gitter
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:33
lol
one sec brb
William McGann
@tehbilly
Nov 14 2014 17:34
func AddClosedHandler(h *thrust.Handler) {
  // STUFF HERE
  dispatch.stuffers();
}
omg yessss
(I mostly wanted to test that code block.
But yes, doing them namespaced that way would be a good shorthand, and then have a special "all of the events" one as well, for handlers that want to do logging/etc.
Then your flow goes reader --> dispatcher --> call method on ONLY interested handlers (performance gain)
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:37
hmm yes that makes sense
William McGann
@tehbilly
Nov 14 2014 17:37
Simpler dependency graph, as well.
And if you use channels for the event handoff (events will be copied, slight memory cost, but safer) you can read/respond to events much faster.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:37
how do we handle target_ids?
William McGann
@tehbilly
Nov 14 2014 17:38
Explain this to me!
For request/response style stuff? Where we are waiting for a response for a specific message we sent?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:38
test
William McGann
@tehbilly
Nov 14 2014 17:38
Bitchin, right?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:38
just testing the go md
William McGann
@tehbilly
Nov 14 2014 17:39
    go func() {
        for {
            select {
            case <-quit:
                fmt.Print("\n")
                return
            case <-time.After(time.Second):
                if Log.LogInfo() {
                    fmt.Print(".")
                }
            }
        }
    }()
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:39
type Handler func (*cr CommandResponse)
William McGann
@tehbilly
Nov 14 2014 17:39
Ok, that works pretty damn well.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:40
thrust.Handler{
  if (cr.TargetID === mywindow.TargetID) {
     // then do something
  }
}
dammit keep forgetting to hold shift
William McGann
@tehbilly
Nov 14 2014 17:40
ctrl+/ switches from compose mode to chat mode and back, apparently.
In compose mode you ctrl+enter to send, otherwise enter works like you'd expect.
That excites me more than it should, lol. So anyways, you mean for req/response type stuff?
I tell Thrust to do X, it responds with Y that X was completed.
Ooooh, so are handlers only for responses to specific commands? Events aren't sent that don't correlate to a pushed command?
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:42
no events are sent also, but they always have a target id
Logging is probably the simplest thing to do, everything else involves checking for TargetID
William McGann
@tehbilly
Nov 14 2014 17:43
So there aren't global events.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:43
nope
William McGann
@tehbilly
Nov 14 2014 17:43
Then you can kinda ignore my typed handler example above. You make a handler, the struct should include the object the handler is for, which includes the id.
So your dispatcher can check for that before sending on the event chan or calling the handler method.
if (handler.Blah.ID == event.TargetID) {
  handler.Event <- event
}
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:45
Yes
should we use an Interface or a Func for the argument to "Register" or "Add"
William McGann
@tehbilly
Nov 14 2014 17:46
Make it a small-buffered channel to not block the dispatcher, send the event on the chan in a select so you can timeout and detect hung handlers, and your handler itself ONLY has to worry about processing the event.
A type. Which I'd define in the main package. type Handler struct { etc. etc. etc.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:47
ah ok
btw, we need to actually create a main thrust package
so that go get does not fail
William McGann
@tehbilly
Nov 14 2014 17:49
myHandler := thrust.NewHandler()
myHandler.Handle = funcHere
myHandler.SetSomething("blah")
thrust.AddHandler(myHandler)
That can be done with a very simple placeholder.
I was going to submit a PR later with common moved to the root level.
Gah, I need to go get food. It's almost time for the cafeteria to get crowded, lol. Sorry I've been rambling, hopefully the perspective helps. It's nice just being distracted from my massive refactoring and environment setup project...
Michael Hernandez
@miketheprogrammer
Nov 14 2014 17:51
@tehbilly thank makes sense
sounds good, catch you later
William McGann
@tehbilly
Nov 14 2014 18:02
Oh man, those code blocks even look good on mobile. I wish they had a native android client out already
Michael Hernandez
@miketheprogrammer
Nov 14 2014 18:08
:)
we might wayyyy down the road be able to create a go-thrust-cef which uses a Thrust style wrapper around cef, and target GOOS=android
maybe, just maybe, but thats farrrr away
then we would be able to make gitter.im for android hehe :)
@tehbilly where in VA are you from, my girls family is from Surry close to Newport News
William McGann
@tehbilly
Nov 14 2014 18:15
I'm in central VA, around Lynchburg. Gitter supposedly has an android client on the way
Michael Hernandez
@miketheprogrammer
Nov 14 2014 18:31
cool
William McGann
@tehbilly
Nov 14 2014 18:32
It's a terrible thing that there's a vape shop almost across the street from work. The good thing is that I have a pile of store credit for building mods for them, ha
Michael Hernandez
@miketheprogrammer
Nov 14 2014 18:32
holy shit guys, im chatting on gitter.im from JankyBrowser using go-thrust
in about 40 lines of go code. :smile:
Michael Hernandez
@miketheprogrammer
Nov 14 2014 18:43
btw: I have created a branch since our changes will be breaking
please PR into that.
I am also not hesitant to give commit privs if you want it, but i def wont be giving commit privs out to the world, but if you plan to make contributions you definitely should have it
let me know
William McGann
@tehbilly
Nov 14 2014 18:46
I appreciate it, would make life easier than pull requests. But let me get a couple in to make sure you're happy with suggestions, code quality, me in general. Don't give me the ability to fuck it up without getting to know my stuff first!
I mean I know I'm awesome, but you don't. :p
Michael Hernandez
@miketheprogrammer
Nov 14 2014 18:49
@tehbilly - Done
Michael Hernandez
@miketheprogrammer
Nov 14 2014 19:04
@lorddoig hows it going
William McGann
@tehbilly
Nov 14 2014 19:49
H'okay, almost got it working within my highly constrained environment. I'm on production support duties this week, so my free time at work is much less than it normally is.
William McGann
@tehbilly
Nov 14 2014 20:10
Nothing better than asking developers to run queries for BAs instead of them running the queries themselves.
Michael Hernandez
@miketheprogrammer
Nov 14 2014 20:28
lol yep
almost brought down one of my production servers
some nodejs processes that were launched by cron werent properly closing due to a removal of socket.unref() . Machine almost ran out of swap
thank god the cron was on 6 hour intervals
Michael Hernandez
@miketheprogrammer
Nov 14 2014 20:35
just fixed it a few minutes ago
Michael Hernandez
@miketheprogrammer
Nov 14 2014 20:54
i love using time.After now
William McGann
@tehbilly
Nov 14 2014 21:08
Heh, wait until you see the beauty of time.Every
After is a great damn function, too. Look at how it's implemented.
I could probably type it out from memory on this phone in a few minutes, I want to print it out and frame it
Michael Hernandez
@miketheprogrammer
Nov 14 2014 21:15
ill have to check it out
this spawn rewrite is going pretty well
adding error bubbling instead of the original impl which just ignore errors or panic'd
Michael Hernandez
@miketheprogrammer
Nov 14 2014 21:21
@tehbilly check out the traffic on the gh repo
its pretty damn good
William McGann
@tehbilly
Nov 14 2014 21:22
Panic is bad bad bad, I don't think I've ever used it unless I'm running a single-purpose server that's monitored by goemon
Michael Hernandez
@miketheprogrammer
Nov 14 2014 21:23
yea, my goal was to prototype this as quick as possible and learn as I went. I made alot of poor decisions that im finally just learning are bad :)
but hey thats learning isnt it
William McGann
@tehbilly
Nov 14 2014 21:25
Hell yeah it is, but if people were afraid of making mistakes they'd never make anything at all.
Let me look here see at the traffic.
William McGann
@tehbilly
Nov 14 2014 21:40
Nice. I'm pretty sure it'll only snowball, too. Especially if it works as well as I hope it does.
NodeWebkit needs a better alternative. Especially for go developers. A cross-platform UI system is extremely difficult to do due to the state of UI fragmentation.
William McGann
@tehbilly
Nov 14 2014 21:50
I'll reply when I get back to my desk. Curious, why are there two places that the directory is specified? Far too distracting workday today. No baby this weekend, so I'll have hours and hours to devote :D
Michael Hernandez
@miketheprogrammer
Nov 14 2014 21:58
jankybrowser running on linux
im proposing this weekend to my girl, so will be gone most of the weekend
@tehbilly, exactly, which is why we need strong dev's to help take this thing to the next level, it is too much responsibility for one developer.
Ok, gentlemen I am heading home, i should be on later from home, im on EST (GMT-400) time hailing from New York City
Michael Hernandez
@miketheprogrammer
Nov 14 2014 22:08
p.s. if one of you can figure out how not to launch the terminal when running the final exe that would be AWESOME
users dont typically want to see a cmd prompt popup on windows.
William McGann
@tehbilly
Nov 14 2014 22:21
In windows? Aye, there's a trick for that. -ldflags -H=windowsgui
So go build -ldflags -H=windowsgui, if I remember correctly.
Which, awesomely, works in go get as well. If you're go geting an executable, not a library, just makes it work like you'd expect.
Also, good luck with the proposal! Although I'm sure you're not asking if you didn't already know the answer. :P
Michael Hernandez
@miketheprogrammer
Nov 14 2014 23:26
does it work the same for linux ?
can i say -H=linuxgui or darwingui
Michael Hernandez
@miketheprogrammer
Nov 14 2014 23:33
sorry that link i sent earlier to imgur was actually jankybrowser running on windows
proof of simple portability
Nice, your ldflags trick worked
expect you do -ldflags '-H=windowsgui' technically