<Groogy>
Yeah I was wondering if return "foo" would make a return in the method I declare the Proc or if it does a return in the Proc
<Groogy>
since you also have break "foo"
<Groogy>
for blocks
<FromGitter>
<girng> whats the diff between proc and a method?
ashirase has quit [Ping timeout: 244 seconds]
ashirase has joined #crystal-lang
<woodruffw>
from my understanding: procs are objects, methods are syntax-level constructs
zorp has quit [Ping timeout: 252 seconds]
gtramontina has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
zorp has joined #crystal-lang
zorp_ has joined #crystal-lang
zorp has quit [Ping timeout: 272 seconds]
gtramontina has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
zorp_ has quit [Ping timeout: 244 seconds]
DTZUZO has joined #crystal-lang
gtramontina has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
DTZUZO has quit [Ping timeout: 252 seconds]
pabs has quit [Ping timeout: 268 seconds]
DTZUZO has joined #crystal-lang
<atna>
I *think* Procs are closures which can encapsulate data from the context they were written in, and realised as objects with a call method. So a = 12; some_func(->(x) { a * 32 }) will create something like (in pseudocode) object { @a = 12; call(x): @a * x }. But the @a value won't actually be copied, it'll be a reference to the real a.
<FromGitter>
<DanielSokil> Could someone please guide me what I'm doing wrong? ⏎ Error: `Error in 100_doors.cr:7: undefined method '[]=' for NamedTuple(door: Int32.class, open: Bool.class)` ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5b85087058a3797aa3c90211]
<FromGitter>
<vladfaust> It should work just as like you've installed a shard from external location
<FromGitter>
<talbergs> hmm, maybe the OS again is issue, (osx)
<FromGitter>
<diegogub_gitlab> hi guys, I keep having issues with DNS into docker and crystal. I saw all the github issues, and seems to be resolved..but still I can't make it work. Someone has any idea how could I do a work around? Docker is running in host network mode.
<FromGitter>
<diegogub_gitlab> trying out with other languages and same configuration seem to work
<FromGitter>
<talbergs> do you know about `docker.for.mac.localhost`?
<FromGitter>
<diegogub_gitlab> @talbergs no, sorry. what's that? I'm running on linux
<FromGitter>
<talbergs> nvm, that is an answer to most of problems relating DNS if you on OSX.
zorp_ has joined #crystal-lang
<FromGitter>
<ninetailschris> Is there a way to edit the elements in a Array(JSON::Any)?
<FromGitter>
<asterite> Yes
gtramontina has joined #crystal-lang
shalmezad has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<vladfaust> I'm having 100k rps with wrk on 4 cores
<FromGitter>
<yxhuvud> yaml is not necessarily transferable to legal json.
<FromGitter>
<yxhuvud> json on the other hand doesn't need to be converted - it is already legal yaml.
Flipez has joined #crystal-lang
alex`` has quit [Ping timeout: 244 seconds]
<FromGitter>
<j8r> How can I convert a JSON::Any to Yaml?
alex`` has joined #crystal-lang
<jokke>
Yxhuvud: sure, but shouldn't at least Hash(String, JSON::Any).from_yaml work?
<jokke>
it seems hash doesn't implement from_yaml
<jokke>
which is weird to me
<jokke>
never mind
<jokke>
of course it does
<jokke>
wait what..? recursive aliases aren't possible anymore?
<jokke>
no i'm just dum
<jokke>
b
<FromGitter>
<talbergs> Uff, @vladfaust I found that my shard will not work (as I stated above) because of hyphen in it's name, changed `name: crystal-dgraph` into `name: dgraph` and I could `require "dgraph"`, but not `require "crystal-dgraph"` seems like #bug ?
<jokke>
hm so there's no way of parsing yaml into a json conform data structure?
<FromGitter>
<vladfaust> @talbergs never had such an issue, maybe you've done something wrong like mispelled shard name in either shard.yml
<z64>
raze is more minimalist than kemal, but you may consider that its just not as far into development. its mostly focused around the way it handles middleware
akaiiro has quit [Ping timeout: 272 seconds]
akaiiro has joined #crystal-lang
<FromGitter>
<j8r> and also not maintained anymore
<FromGitter>
<j8r> that's why I've finally closed my PR and contribute to Kemal, which has also better tests coverage
<z64>
yeah its unfortunate as i really liked the direction raze was heading over kemal
<jokke>
does anyone know of a way to provide a dsl to set instance vars of an object where not all if any instance vars are nilable?
<jokke>
i already discovered that double splat initializers can be used for mass assigning the instance vars
<jokke>
but i'm not sure how a dsl would look like without having to write it completely manually
<jokke>
oh and this should be completely type safe too and checked at compile time too :D
gtramontina has quit [Remote host closed the connection]
<FromGitter>
<ninetailschris> How can I convert Array(JSON::Any) into a regular array?
<FromGitter>
<asterite> it depends... what do you have in the `JSON::Any`?
gtramontina has joined #crystal-lang
<FromGitter>
<ninetailschris> its just nested arrays with intergers and strings inside an array example being [[127, [12, 24, 22, 13, 14, 18], [0, 252, 0, 0, 0, 0, 0], 100, 2352, 13, 1, 0, false, "Cow", 0]]
<FromGitter>
<bew> false in your data is not a string or an integer
<jokke>
wu... instance variable '@schemas' of OpenAPI::Components must be (Hash(Symbol, OpenAPI::Reference | OpenAPI::Schema) | Nil), not Hash(Symbol, OpenAPI::Schema)
<jokke>
*wut
<FromGitter>
<ninetailschris> Forgot to add bool. Sorry about that
<jokke>
how is Hash(Symbol, OpenAPI::Schema) not a part of (Hash(Symbol, OpenAPI::Reference | OpenAPI::Schema) | Nil)?
<jokke>
z64: take a look at prism
<jokke>
early stages but really cool
<jokke>
especially the param handling
<z64>
yeah i've been meaning to. writing the frontend component for my project soon, so i plan to start re-evaluating what my webserver needs will be
<FromGitter>
<girng> @atna ty for explanation same for @woodruffw. i'm going to just stick to methods for now until i need to use procs
<FromGitter>
<paulcsmith> Yay for 0.26.1! Thanks for the new release Crystal team :D
<FromGitter>
<paulcsmith> Homebrew having a release at the same time is an extra nice surprise 👍
<FromGitter>
<bcardiff> :-) < 24hs between tagging and releasing. I know in this era of extra connectivity it seems like an eternity, but with the whole process is not that much.
<FromGitter>
<eliasjpr> Interesting presentation about Scala compiler
<FromGitter>
<girng> @rishavs which ones?
<FromGitter>
<girng> @rishavs if they don't u can use pm2 and basically make nodejs run on multiple cores.and use redis for pub sub thjat's what i use to do
<FromGitter>
<girng> now that I think of it, we can do the same with crystal since their redis shard is epic
ua__ has quit [Quit: Leaving]
<FromGitter>
<rishavs> fastify.io mainly. I am torn between fastify and crystal based REST api. my deployment plan is to use a single processor doker container and then conjure up as many instances of the server as I need to.
<FromGitter>
<rishavs> And fastify compares well wit crystal in terms of single processor speed.
ua has joined #crystal-lang
<FromGitter>
<vlazar> @rishavs are you comparing some real REST API endpoint in Crystal/fastify or is it just a hello world benchmark?
<FromGitter>
<rishavs> I am looking to decide on a lang/framework for my next toy project. It is to be a spa with a rest api based backend. so, no code so far.
<FromGitter>
<rishavs> itching to give elm 0.19 a try
<FromGitter>
<vlazar> TFB results provide at least some idea of what to expect in different scenarious
<FromGitter>
<vlazar> for example Crystal performs very well in JSON benchmark
<FromGitter>
<vlazar> for DB the results are not that excited, but it's a good idea to benchmark you specific use case, not some generic
<FromGitter>
<rishavs> yep
akaiiro has quit [Remote host closed the connection]
<FromGitter>
<j8r> If you use an integrated db like leveldb or rocksdb you can get the best performance, specially there is no ffi overhead
akaiiro has joined #crystal-lang
gtramontina has quit [Ping timeout: 272 seconds]
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 240 seconds]
gtramontina has joined #crystal-lang
akaiiro has quit [Quit: Ping timeout (120 seconds)]
gtramontina has quit [Ping timeout: 272 seconds]
akaiiro has joined #crystal-lang
Groogy has quit [Quit: WeeChat 2.2]
gtramontina has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
<FromGitter>
<GaryMiller> Is SQLite integrated too? Or does it require the ffi overhead? When the Windows Crystal is ready I was hoping to port my pypy SQLite projecct to it to see if I could get a speedup.
gtramontina has quit [Ping timeout: 245 seconds]
akaiiro has quit [Ping timeout: 246 seconds]
akaiiro has joined #crystal-lang
gtramontina has joined #crystal-lang
tilpner has quit [Remote host closed the connection]
<FromGitter>
<bcardiff> @GaryMiller crystal-sqlite uses libsqlite3 . crystal-mysql and pg implement the protocol without extra dependencies.
moei has joined #crystal-lang
tilpner has joined #crystal-lang
akaiiro has quit [Ping timeout: 240 seconds]
akaiiro has joined #crystal-lang
gtramontina has quit [Ping timeout: 252 seconds]
gtramontina has joined #crystal-lang
shalmezad has quit [Quit: Leaving]
gtramontina has quit [Ping timeout: 246 seconds]
gtramontina has joined #crystal-lang
gtramontina has quit [Ping timeout: 245 seconds]
gtramontina has joined #crystal-lang
<FromGitter>
<j8r> @GaryMiller and there is no ffi overhead in Crystal
gtramontina has quit [Ping timeout: 246 seconds]
sevensidedmarble has joined #crystal-lang
gtramontina has joined #crystal-lang
Yxhuvud has quit [Ping timeout: 276 seconds]
gtramontina has quit [Ping timeout: 245 seconds]
<FromGitter>
<diegogub_gitlab> someone using crystal in docker from scratch? I'm having issues with ssl.. @bcardiff I followed your post on the blog
sevensidedmarble has quit [Ping timeout: 264 seconds]
sevensidedmarble has joined #crystal-lang
<sevensidedmarble>
Is there a way to get the arguments defined on a proc?
<FromGitter>
<bcardiff> @diegogub_gitlab you might need to install openssl or libssl manually
gtramontina has joined #crystal-lang
<FromGitter>
<diegogub_gitlab> do you mean copying the correct files to the scratch right?
<FromGitter>
<bcardiff> that or running apt-get install in the Dockerfile. it depends in your dev env
<FromGitter>
<diegogub_gitlab> @bcardiff I see.. I will try, the issue I think is that openssl can't find the certs on the docker scratch, because I tried to turn off validation and works for https..gracias!
<FromGitter>
<bcardiff> Try to make a small sample of what you are trying to do so you can share some code. De nada!
gtramontina has quit [Ping timeout: 252 seconds]
sevensidedmarble has quit [Ping timeout: 252 seconds]
gtramontina has joined #crystal-lang
sagax has quit [Ping timeout: 252 seconds]
gtramontina has quit [Ping timeout: 240 seconds]
sevensidedmarble has joined #crystal-lang
return0e has quit [Read error: Connection reset by peer]