<FromGitter>
<schoening> @Papierkorb that was the one! And according to wiki the alternative (like node.js, crystal/kemal, etc) is called FastCGI
<FromGitter>
<schoening> thanks!
<Papierkorb>
that's the protocol, yeah
Aytan72 has quit [Remote host closed the connection]
Aytan72 has joined #crystal-lang
<Papierkorb>
Though usually you implement HTTP anyway nowadays
<FromGitter>
<schoening> Well now I have more stuff to look into :D
<FromGitter>
<schoening> I just finished my first week at my first programming job. It uses some ancient .net 1.0 (in some places) and that seems to be working in the cgi fashion so I was interested on the topic ^^
Aytan72 has quit [Ping timeout: 246 seconds]
<FromGitter>
<schoening> Ohh Ruby can't do method overloading.. Crystal is way cooler
<Papierkorb>
Ruby is completely dynamic, doesn't make too much sense to do that in ruby
<Papierkorb>
only thing that you could do overloading with would be count of arguments
<Papierkorb>
Though I also really appreciate method overloading in Crystal
<Papierkorb>
schoening, how much coding experience you got in total?
<FromGitter>
<schoening> How do you quantify that
<Papierkorb>
years of actively doing something
<FromGitter>
<schoening> Hm.. Good question. I think I first started playing around with code 5 years ago.
<FromGitter>
<schoening> Why
<Papierkorb>
If you haven't done network programming yet, you can try implementing FastCGI
<Papierkorb>
it's not too complex, but interesting enough if you haven't done network programming yet
<FromGitter>
<schoening> I have no idea how to get started :D
<Papierkorb>
Am I right to assume you didn't do network programming yet, though have an interest in doing so?
<FromGitter>
<schoening> I have written web applications and rest api. But I think you are talking about on a deeper level?
<Papierkorb>
Implementing a TCP/network protocol, not using a library implementing one, yesy
<Papierkorb>
*yes
<FromGitter>
<schoening> I would like to know how computers actually comunicate not just the fluff on top
<Papierkorb>
Great
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<Papierkorb>
Well, some protocols that are beginner friendly are: HTTP (text based), FastCGI (binary iirc), IRC (text based)
<Papierkorb>
All of them are TCP, and have proper RFCs, are stable and are well documented in general ("Google-able")
<Papierkorb>
Basically, networking libs have two different kinds of complexity: Architecture ("what does what"), and the logic itself ("how does it what")
<Papierkorb>
What the logic implements is defined by the RFC, reference documents, or whatever you use
<Papierkorb>
Architecture is guided by it to some extend, but not that much either. More often than not, this is the harder problem
<FromGitter>
<schoening> Is HTTP and FastCGI roughly equally hard to implement?
<Papierkorb>
But focus on the logic first. First, decide one a protocol, and implement its logic. in a single file or something. Start with the first packet needed: If it needs a handshake (The packet sequence exchanged first between client and server), that. If not (Like in HTTP), then the simplest packet. and then improve upon that until you're implementing a satisfiable amount
<Papierkorb>
HTTP is darn simple, you can literally implement it as bash script
<Papierkorb>
FastCGI is more annoying at first as you have to configure an NGINX or something to talk to
<Papierkorb>
The complexity of HTTP is not getting to work, but to get it "right"
<FromGitter>
<schoening> I think I should do that first since I have no idea how to implement any of this yet
<Papierkorb>
If you don't have it already, install Wireshark too to sniff communication between you and the server
<Papierkorb>
Great
<Papierkorb>
Now, decide if you want to implement a server or client
<Papierkorb>
Client is easier I'd guess, easier to check too
<FromGitter>
<schoening> I mean. I get it on the level I need for my work. But I don't really understand how two machines can send data to each other..
Aytan72 has joined #crystal-lang
<Papierkorb>
Does the "OSI model" tell you anything?
<Papierkorb>
do you know what it is?
<FromGitter>
<schoening> No
<FromGitter>
<schoening> So far I have only been using all the existing tech to build stuff with. Not how they are implemented.
<FromGitter>
<schoening> What do you work with btw Papierkorb
<FromGitter>
<schoening> osi model looks similar to some models i have seen of operating systems
<Papierkorb>
Overview is roughly: A network (on that level) consists of multiple protocols stacked upon each other. First comes the physical wire itself (or air for wifi), then some one or two protocols, then the IP (Internet Protocol), and then TCP.
<Papierkorb>
That's really rough ^ :)
<Papierkorb>
Either way, if you want to understand what's actually going on, I'd start with the TCP (Transmission Control Protocol) article on Wikipedia. Not even kidding. Don't read it in full, just skim it for now, it's probably long.
<Papierkorb>
Then read about TCPSocket (That's a Crystal class, require "socket" for it), and which methods you need
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Papierkorb>
`TCPSocket.new("123.123.123.123", 1234)` will get you a connection to that address, and then just write into and read from it. Nothing more to worry about yet on that level
<FromGitter>
<schoening> Nice. Thank you. I open the tabs and start reading until I fall asleep. Its almost 3 am :D
<Papierkorb>
Try to implement a simple http command now, this will be `GET`. Tip: Build a small HTTP server using whatever you like which sends you a `Hello World` message upon requesting something
<Papierkorb>
Yup almost 3am here as well ^^
<Papierkorb>
What did you mean by what I'm working with?
<FromGitter>
<schoening> Whats your job, or rather, why do you know this stuff I suppose
<Papierkorb>
I've been coding since I was ten years old, you get to know stuff after doing things for many years I guess :)
<FromGitter>
<schoening> cool :)
<Papierkorb>
my job, intern as software engineer. Can't wait to get out of uni though. Boring.
<Papierkorb>
Not too important though. Sharing knowledge is the most fun any way.
<FromGitter>
<schoening> Haha. Im glad Im done with school two. It almost killed my passion for programming
<FromGitter>
<schoening> amen
<Papierkorb>
I'd usually at this point tell you that it'd be fine to /query me w.r.t. networking specific questions if you wanted, though I'm on IRC so no idea if the bridge bot allows this
<FromGitter>
<schoening> I can just jump on the irc in those cases np :) thanks
<FromGitter>
<schoening> time for bed. gn
<Papierkorb>
gn
Aytan72 has quit [Remote host closed the connection]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Aytan72 has joined #crystal-lang
bjz has joined #crystal-lang
Aytan72 has quit []
maxpowa has quit [Ping timeout: 260 seconds]
maxpowa has joined #crystal-lang
gchase has joined #crystal-lang
<gchase>
anyone here?
gchase has quit [Client Quit]
<FromGitter>
<fridgerator> sort of
maxpowa has quit [Ping timeout: 260 seconds]
maxpowa has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
bjz_ has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
sz0 has joined #crystal-lang
<wuehlmaus>
hi, all! can someone point me to an example where a unix pipe is used. i was searching for it and first thought IO had popen which it does not. i think it's in "process" but i don't understand it.
<FromGitter>
<bew> you don't need to use pipe directly, `Process` abstract this
<FromGitter>
<bew> Oo @oprypin do you store all your tests somewhere? or how did you fund that one?
<FromGitter>
<bew> found*
<oprypin>
bew, i posted this earlier in irc and i have irc logs
<FromGitter>
<bew> yeah I remember, you searched the logs and found it, didn't you?
<oprypin>
yes
<FromGitter>
<bew> nice
<FromGitter>
<bew> Do you know why IOs given to process can't be a filedescriptor ? `needs_pipe?` is `io.nil? || (io.is_a?(IO) && !io.is_a?(IO::FileDescriptor))`
<oprypin>
bew, uhh i think this is a check whether the abstraction needs to introduce a level of indirection
<oprypin>
io nil means "the caller requests some io" so we'll make a pipe. io being a file descriptor means it can be piped directly so we don't need to wrap it, other ios need to be wrapped
<FromGitter>
<bew> ok I see!
<FromGitter>
<bew> about the `io.nil?` meaning that a pipe needs to be created, I'd expect `io == true` to do that (not when it's nil)
<oprypin>
bew, it's just a silly convention for the arg. there have been some suggestions to rework this
<FromGitter>
<bew> the arguments of `IO.pipe` are booleans, for reading/writing in a blocking way (see the api doc)
<wuehlmaus>
hmm, doesn't work, it puts out the "hello" but less is not used
<oprypin>
wuehlmaus, of course it's not used, this is entirely irrelevant
<oprypin>
just forget everything and look at my example
<FromGitter>
<bew> a pipe only creates a tunnel between 2 file descrptors... You might want to use `Process.new "less"` and feed the input of the process
<FromGitter>
<bew> wuehlmaus: this works for me: https://carc.in/#/r/1zkc (carc.in just crashes because less is not installed)
<wuehlmaus>
bew: oprypin thanks for the help
<wuehlmaus>
oprypin: ^^^
<FromGitter>
<bew> yw! does it works for you?
<wuehlmaus>
yes, it's what i wanted
Ven has joined #crystal-lang
Ven is now known as Guest35758
Guest35758 has quit [Client Quit]
Ven_ has joined #crystal-lang
Ven_ has quit [Client Quit]
splitty___ has joined #crystal-lang
splitty_ has joined #crystal-lang
splitty__ has quit [Ping timeout: 260 seconds]
splitty___ has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest37184
<wuehlmaus>
what's the easiest to use crystal ide right now?
<txdv>
what crystal ide?
<wuehlmaus>
i am using vim right now, but a more powerful completion system would be handy
<wuehlmaus>
yeah
<wuehlmaus>
actually vim would be best as i am most confortable with it for 2 decades
<wuehlmaus>
but i take what helps the most
<RX14>
there isn't really a crystal IDE yet
<RX14>
but we'll get there one day i'm sure
<wuehlmaus>
right now i am using icr with the help of {{@type.methods.map &.name.stringify}}.sort.uniq
<wuehlmaus>
but even that misses some methods now and then :)
<wuehlmaus>
e.g. IO.pipe obviously :)
Guest37184 has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
<RX14>
why not use the documentation?
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 268 seconds]
Ven has joined #crystal-lang
Ven is now known as Guest45772
Guest45772 has quit [Ping timeout: 260 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 258 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven is now known as Guest38218
Guest38218 has quit [Ping timeout: 240 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Ping timeout: 245 seconds]
Ven_ has joined #crystal-lang
Ven_ has quit [Read error: Connection reset by peer]
Ven_ has joined #crystal-lang
Ven_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
codealchemy has joined #crystal-lang
codealchemy has quit [Quit: WeeChat 1.5]
Ven has joined #crystal-lang
Ven is now known as Guest29528
Guest29528 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]