ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.32.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
return0e has joined #crystal-lang
<FromGitter> <wontruefree> can you add something in the docs for that
<FromGitter> <wontruefree> I dont know if I understand
<FromGitter> <636f7374> @wontruefree Sorry, I am conceiving a SOCKS5 Mask based on HTTP 1.1 KeepAlive.
<FromGitter> <636f7374> @wontruefree I will add more documentation and tests later.
<FromGitter> <636f7374> @wontruefree But very simple, basically most of the functions are in examples.
<FromGitter> <636f7374> @wontruefree I just added Socket wrapper support to the Client / Server.
<FromGitter> <636f7374> Now it can use TCPServer / TCPSocket or UNIXServer / UNIXSocket or something。
<FromGitter> <acoolstraw> heya
alexherbo2 has quit [Ping timeout: 265 seconds]
ur5us has quit [Ping timeout: 240 seconds]
_ht has joined #crystal-lang
bazaar has quit [Ping timeout: 268 seconds]
_ht has quit [Remote host closed the connection]
bazaar has joined #crystal-lang
ur5us has joined #crystal-lang
davic has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 272 seconds]
alexherbo2 has joined #crystal-lang
alexherbo27 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo27 is now known as alexherbo2
<FromGitter> <ImAHopelessDev_gitlab> @acoolstraw heya
davic has joined #crystal-lang
HumanG33k has joined #crystal-lang
alexherbo25 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo25 is now known as alexherbo2
alexherbo21 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 240 seconds]
alexherbo21 is now known as alexherbo2
teardown has joined #crystal-lang
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
<FromGitter> <ImAHopelessDev_gitlab> how is everyone
<FromGitter> <ImAHopelessDev_gitlab> slow day today??
<FromGitter> <watzon> Seems to be
ur5us has joined #crystal-lang
postmodern has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 260 seconds]
alexherbo2 has joined #crystal-lang
_ht has joined #crystal-lang
<FromGitter> <wontruefree> @636f7374 awesome !!!!!
<FromGitter> <wontruefree> thanks for the update
return0e_ has joined #crystal-lang
return0e has quit [Ping timeout: 240 seconds]
_ht has quit [Remote host closed the connection]
<raz> say i have: macro foobar(arg). can i somehow distinguish inside the macro whether it was called with a literal foobar("batz") or a variable, foobar(batz)?
<raz> n/m. is_a? just works. as i should've expected.
<raz> crystal awesomeness is recursive
chachasmooth has quit [Ping timeout: 272 seconds]
chachasmooth has joined #crystal-lang
<FromGitter> <Blacksmoke16> what was the usecase?
<FromGitter> <Blacksmoke16> is possible to turn `"batz"` into `batz` anyway
<FromGitter> <636f7374> Beerware is a somewhat tongue-in-cheek term for software released under a very relaxed license (beerware licensed software). It provides the end user with the right to use a particular program (or do anything else with the source code).[2]
<FromGitter> <636f7374> Should the user of the product meet the author and consider the software useful, they are encouraged to either buy the author a beer "in return" or drink one themselves. The Fedora project and Humanitarian-FOSS project at Trinity College recognized the "version 42" beerware license variant as extremely permissive "copyright only" license, and consider it as GPL compatible.[3][4] As of 2016 the Free Software
<FromGitter> ... Foundation does not mention this license explicitly, but its list of licenses contains an entry for informal licenses, which are listed as free, non-copyleft, and GPL-compatible. However, the FSF recommends the use of more detailed licenses over informal ones.[1]
<FromGitter> <Blacksmoke16> or the other way around
<FromGitter> <636f7374> 1) <phk@FreeBSD.ORG> wrote this file. As long as you retain this notice you ⏎ 2) can do whatever you want with this stuff. If we meet some day, and you think ⏎ 3) this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp
<FromGitter> <636f7374> :)
<FromGitter> <tenebrousedge> 🍺 makes the 🌍 go β­•
<FromGitter> <tenebrousedge> or possibly ➰
<FromGitter> <kinxer> @raz This works: https://carc.in/#/r/8jv8
<FromGitter> <636f7374> πŸ˜€
<FromGitter> <636f7374> Crystal's built-in logger performs very poorly, does anyone want to reproduce the implementation?
<FromGitter> <636f7374> Crystal built-in Logger uses Mutex internally.
<raz> kinxer thx, found it :)
<FromGitter> <636f7374> Java `log4j` uses a lock-free queue logger.
<FromGitter> <636f7374> Has anyone considered this issue? On a very large website, Mutex may experience performance problem.
<raz> hmm, i have another macro question. i want to basically do {% for name in `cat list.txt` %} call_other_macro(name) {% end %}. anyone know if that's possible? (this syntax sadly doesn't work)
<FromGitter> <636f7374> Log4j – Performance - Apache Logging Services (https://logging.apache.org/log4j/2.x/performance.html)
<FromGitter> <kinxer> Unrelated, I seem to remember an electric vehicle company supporting Crystal at some point or maybe just using it in production. Does anyone else recall what that company was?
<FromGitter> <636f7374> @kinxer Okay, But in C10K, C1M may encounter some problems?
<FromGitter> <636f7374> Asynchronous logging is useful to deal with bursts of events. How this works is that a minimum amount of work is done by the application thread to capture all required information in a log event, and this log event is then put on a queue for later processing by a background thread. As long as the queue is sized large enough, the application threads should be able to spend very little time on the logging call
<FromGitter> ... and return to the business logic very quickly. ⏎ ⏎ It turns out that the choice of queue is extremely important for peak throughput. Log4j 2's Async Loggers use a lock-free data structure, whereas Logback, Log4j 1.2 and Log4j 2's Asynchronous Appenders use an ArrayBlockingQueue. With a blocking queue, multi-threaded applic ... [https://gitter.im/crystal-lang/crystal?at=5e448a2f1d23aa47aa0e73ae]
<FromGitter> <kinxer> @636f7374 ?
<FromGitter> <kinxer> I agree that an asynchronous logger as in Log4J would be really useful. I just don't know why you @'d me.
<FromGitter> <636f7374> @kinxer C10K Problem Wikipedia (https://en.wikipedia.org/wiki/C10k_problem)
<FromGitter> <636f7374> πŸ˜…
<raz> 636f7374, quickest solution: build a shard that's api-compatible with builtin logger, ask to have it merged to stdlib ;)
<FromGitter> <636f7374> I think it should be used as a third-party shards, because log4j and log4rs are independent (relative to the official).
<FromGitter> <636f7374> :)
<FromGitter> <kinxer> I think a good first step would be implementing a non-blocking queue shard, since that could be more widely applicable. Log4J doesn't implement their own, do they?
<raz> nothing wrong with having that in stdlib imho. ideally with a toggle for queued vs synchronous logging
<raz> but yes, shard would work equally well
<FromGitter> <kinxer> I agree with @636f7374. The standard library logger doesn't need to be designed to handle all logging needs, just basic ones. As in other language ecosystems, someone with heavy or complex logging needs should use or write a library for it.
<FromGitter> <636f7374> πŸ™‚πŸ‘
<raz> i tend to disagree, but don't have a strong opinion on it anyway. i've long given up hope for proper logging in any stdlib of any language ;)
<FromGitter> <Blacksmoke16> https://github.com/Blacksmoke16/crylog
<raz> the problem with subpar stdlib logging is that it is what libraries/shards tend to use. so your high performance app may have the fanciest custom logging in the world - the shards it uses will still write to the stdlib logger. and then the monkey patching starts...
<FromGitter> <636f7374> Yes, in Crystal, you first need to convince RX14 :)
<FromGitter> <Blacksmoke16> going to rework it a bit and move it into the athena org, but essentially will be the same
<raz> mine is cooler tho :P
<raz> Blacksmoke16, i have a feeling we have a new competitor coming up!
<raz> crystal should add "most logging options of any language" to its tag line
<FromGitter> <Blacksmoke16> raz: try like `{% for name in `cat input.txt`.split('\n') %}`
<FromGitter> <kinxer> "clog" *is* fun to say.
<FromGitter> <Blacksmoke16> backticks around cat input.txt
* raz scratches head
<raz> Blacksmoke16, almost! but then when i try to {{name}} inside the loop, it gives me the lines with quotes ("name")
<raz> err no wait
<raz> pebcak
<FromGitter> <Blacksmoke16> main issue is doing a sys command like that returns a string literal
<FromGitter> <Blacksmoke16> so you need some way to make it iterable
<raz> hmm yea it seems to iterate fine now. but problem is i only want the inner part of the loop to run at compile time. hmmm.
<FromGitter> <Blacksmoke16> example?
<FromGitter> <Blacksmoke16> also our loggers have diff design goals
<raz> actually, i can do that in the macro that is being called i think
<FromGitter> <Blacksmoke16> mainly making mine work well with DI, also i really like the handler/processor/formatter concept
<raz> gonna try some more stuff, thanks for the pointer!
<FromGitter> <Blacksmoke16> πŸ‘