<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>
<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>
<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.
<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 ;)
<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