RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.24.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
<FromGitter> <jwoertink> Is there a way to tell what called a method?
<FromGitter> <jwoertink> As in what other method called a specific method. Something similar to ruby's `caller_locations`
<FromGitter> <aisrael> From what I’ve seen the easiest thing to do is simple pass in `__FILE__`, and `__LINE__`
<FromGitter> <jwoertink> Wouldn't that just tell me the current file and line I'm in?
snsei has joined #crystal-lang
<FromGitter> <jwoertink> Or maybe there's another way of going about this that I'm not thinking of. Basically, I got this method that is being called twice, but I don't know why, or where
<FromGitter> <jwoertink> If I grep the project, I only see 1 spot that it gets called, so I was thinking maybe if I had something that told me what's calling it, I could see if it's the same thing both times
<FromGitter> <aisrael> If you’re just doing that for troubleshooting, uhm, have you tried throwing an exception the second time it’s called?
<Papierkorb> jwoertink, if you don't feel like using a debugger, you can also generate a stacktrace
<FromGitter> <jwoertink> I would be ok with using a debugger. I tried gdb once, and I had no clue what I was doing lol
<FromGitter> <aisrael> In Ruby it was possible to throw and exception, `rescue` it and then inspect the `backtrace`. Haven’t tried it with Crystal but seems to be possible
<Papierkorb> there are plenty UIs for it
<Papierkorb> kgdb, ddd. possibly also a gdb plugin for your editor
<FromGitter> <jwoertink> whoa. I didn't even consider a UI for that.
<Papierkorb> lol.
snsei has quit [Ping timeout: 276 seconds]
snsei has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
<RX14> just `puts caller`
<RX14> and you get a backtrace
<RX14> its that simple
snsei has quit [Ping timeout: 260 seconds]
<FromGitter> <jwoertink> nice! Thanks dude. That's more of what I was looking for :D
<FromGitter> <jwoertink> however, I did find this https://gdbgui.com/ which is also kinda neat. Now I just gotta figure out how to use it lol
<Papierkorb> you'll want an integration into your editor/IDE. Much more useful in the general case
<Papierkorb> I mean I see it in QtCreator, which has just that OOTB. you don't even begin to write whacko debug output code, starting the debugger is just too easy
<FromGitter> <jwoertink> Any good gdb/vim integrations? I found this Conque one
snsei has joined #crystal-lang
<FromGitter> <jwoertink> Ok, next question. When you inspect an instance and see the `:0x106817eb0>` part, that's memory location, right? So if you inspect 2 instances, and they are the same, then it's the same object?
<FromGitter> <jwoertink> but if they are different, then it's 2 separate instances?
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snsei has quit [Ping timeout: 265 seconds]
<Papierkorb> sure
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
greengriminal has joined #crystal-lang
daemonwrangler has joined #crystal-lang
greengriminal has quit [Read error: No route to host]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
snsei_ has quit [Ping timeout: 265 seconds]
LastWhisper____ has joined #crystal-lang
livcd has quit [Ping timeout: 256 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 265 seconds]
livcd has joined #crystal-lang
jnyw has joined #crystal-lang
greengriminal has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Read error: Connection reset by peer]
rohitpaulk has joined #crystal-lang
pta2002 has joined #crystal-lang
snsei has joined #crystal-lang
<FromGitter> <coderhs> I got an issue don't think its related to SSL, but its happening in my crystal software. This software sends request to a cloud app when we click submit. But recently we renewed our SSL certificate and had to change the certificates in the server. Since then this error has popped up. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a7be603ce68c3bc745ce806]
<FromGitter> <coderhs> any suggestions on how to fix this.
greengriminal has quit [Quit: This computer has gone to sleep]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
hightower3 has joined #crystal-lang
hightower has quit [Ping timeout: 256 seconds]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 252 seconds]
<FromGitter> <coderhs> Upgraded crystal and changed the code for the new version, but getting this error. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a7c003c4a6b0dd32ba40790]
LastWhisper____ has joined #crystal-lang
<FromGitter> <faustinoaq> @coderhs Do you have openssl installed?
<FromGitter> <coderhs> yes,
<FromGitter> <coderhs> updated just now
<FromGitter> <faustinoaq> What OS/distro and crystal version are you using?
brycek has quit [Read error: Connection reset by peer]
brycek has joined #crystal-lang
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alex`` has joined #crystal-lang
danielpclark has joined #crystal-lang
hightower3 has quit [Read error: Connection reset by peer]
hightower3 has joined #crystal-lang
<knight_> woot
<dragonkh> hello
<knight_> hey dragon
<dragonkh> when I do: c = OpenSSL::Cipher.new("aes-128-gcm") ; s=IO::Memory.new ; ... etc ; p s.to_s - I get this: "\xEC$\u001f\fF"
<dragonkh> in javascript: enc = all_crypto.cryptojs.AES.encrypt("hello", "password").toString() - I get "U2FsdGVkX1/T2E7cm5wm4vCvKMMHCoJiWTDqAxBI0RU="
<dragonkh> how can I get Crystal cipher to give me the same kind of string back?
<jnyw> hi, just wondering if anyone has used scry with vim? how was it? is there any special setup I need to do to use it?
LastWhisper____ has joined #crystal-lang
LastWhisper____ has quit [Client Quit]
hightower3 is now known as gightower4
gightower4 is now known as hightower4
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 252 seconds]
jnyw has quit [Quit: WeeChat 2.0.1]
gewo has quit [Quit: WeeChat 1.6]
gewo has joined #crystal-lang
imonmyown has joined #crystal-lang
imonmyown has quit [Ping timeout: 260 seconds]
Ven`` has joined #crystal-lang
Ven`` has quit [Ping timeout: 276 seconds]
<FromGitter> <coderhs> @faustinoaq Ubuntu 16.04 latest crystal 0.24.1 LLVM: 4.0.0
<FromGitter> <Jens0512> When should you use pointers in crystal?
<FromGitter> <straight-shoota> @Jens0512 Only if you need them
<FromGitter> <Jens0512> That's what im wondering, when do i need them?
<FromGitter> <Jens0512> What makes me need them?
<FromGitter> <straight-shoota> mostly for low-level stuff like binding to c libraries
<FromGitter> <Jens0512> Alright, i see, thanks
<FromGitter> <straight-shoota> or if you need to optimize an algorithm for super high performance
<crystal-gh> [crystal] asterite opened pull request #5690: Fix incorrect type for lib extern static array (master...bug/5688-lib-extern-static-array) https://git.io/vAU5m
<FromGitter> <Jens0512> Hmm, any examples?
<FromGitter> <Jens0512> I have been working with some algorithms recently, and high performance is good
<FromGitter> <asterite> for example if you need to write a data-structure like Array or Hash, but even there a Slice can be used for a bit more safety
<FromGitter> <Jens0512> I see, thanks, its an honor to talking of both of you core devs :D
<RX14> @Jens0512 of course the law of premature optimization says to never use pointers straight away
<FromGitter> <Jens0512> And another one XD
<FromGitter> <Jens0512> I see, thanks, i'll remember that
<RX14> I tend to believe that you're unlikely ever to need them
<RX14> in the stdlib we tend to prematurely optimize and use pointers since we're the base of every program
<RX14> but we should probably stop that too
<FromGitter> <Jens0512> Hmm, why should you not use pointers if they improve performance?
<RX14> because they're incredibly unsafe
<FromGitter> <Jens0512> Even if used properly?
<RX14> it's easy to return a pointer to the stack and get a dangling pointer
<RX14> it's easy to get a segfault
<RX14> it's easy to get a security issue without proper bounds checking
<RX14> @Jens0512 history has proved that they cannot be used correctly
<RX14> if you rely on humans not to fuck up when using pointers, you get the sorry state of computer security we currently have now
<FromGitter> <Jens0512> Ok ok, thanks, and i was wondering, the comiler is pretty well documented in the code, but i can't find the web version? When i try to run the doc generator on it, i get an error, saying something like `SOME_CONSTANT is already defined`
<RX14> @Jens0512 run `make doc`
<RX14> web version is obviously easier
<RX14> but the "i can't run crystal doc on the stdlib" issue is common
<RX14> you need to run `make doc` and it runs the compiler specially
rohitpaulk has quit [Ping timeout: 252 seconds]
paleorange has joined #crystal-lang
<paleorange> hey there
<paleorange> is it possible to write a php interpreter __from scratch__ and how?
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vAUbd
<crystal-gh> crystal/master 3086419 asterite: Fix incorrect type for lib extern static array
<FromGitter> <Jens0512> Ok, thanks chris
<FromGitter> <Jens0512> But the docs for a lot of things in the `Crystal` module is not there though
<FromGitter> <Jens0512> For example `Crystal::Program`
<paleorange> well, i think, nobody knows the answer to this question
<FromGitter> <Jens0512> Of course it is possible
<FromGitter> <Jens0512> But the second question seems a bit too broad to be discussed here
<FromGitter> <Jens0512> Just search up on how to create interpreters, they're generally a bit easier to create than compiler imo
<FromGitter> <Jens0512> *compilers
rohitpaulk has joined #crystal-lang
<FromGitter> <straight-shoota> @Jens0512 `Crystal::Program` is an internal API of the compiler, not part of the standard library
<FromGitter> <straight-shoota> paleorange, it's possible but what's the point? There are a lot of PHP interpreters out there and I don't see why you'd need one written in Crystal.
<paleorange> >[a lot], sure, sea of options, php...hhvm...php...hhvm
<paleorange> point is making a subset of php w/o oop
<paleorange> for all the procedural-functional style coders
<FromGitter> <j8r> why still bother with php, the only (major) point is legacy
<paleorange> because it was designed for the web
<paleorange> for making websites
<paleorange> and has low entry point
<Papierkorb> There are plenty better designed languages which are also much easier to implement (correctly) out there. Like Lua for example.
<FromGitter> <j8r> yes totally
<Papierkorb> PHP isn't even defined, even FB turned its back
<FromGitter> <j8r> this is also simple to start with a modern stack, Vue.JS/React + API server
<Papierkorb> A few popular languages have no formal definition for sure, but most aren't as broken as PHP
<paleorange> Lua, you say, is it time-tested? Maybe, is it support by nginx/apache/caddy/lighthttpd? No, is it standalone? No
<paleorange> supported by*
<Papierkorb> lul, it is supported.
<paleorange> by what?
<Papierkorb> And of course it's standalone Oo;
<FromGitter> <j8r> of course, modules in nginx are written in Lua
<FromGitter> <j8r> *some
<Papierkorb> paleorange: I think you're capable of looking it up yourself.
<paleorange> yes, but not on the i-can-run-lua-as-pages-in-the-browser level
<Papierkorb> lul²
<paleorange> so what i'm saying is if hack is "a superset of php" this is going to be a subset of php
<paleorange> briefly look at typescript and coffeescript and you'll probably know what i mean
<FromGitter> <straight-shoota> if you need PHP: there are really quite a few implementations besides zend and hiphop. ph7 for example is an embedded C runtime, so it should be easier to create bindings to that instead of implementing yourself in crystal
<paleorange> but the goal is, saw off not needed features
<paleorange> problem is i can't work with c, if you know c, you are welcome to help
<FromGitter> <straight-shoota> well, then you'll need to write you own or modify an existing parser. essentially you just need to remove the parsing for these features.
<FromGitter> <straight-shoota> though I still don't see what it would be good for
<paleorange> >[for all the procedural-functional style coders out there]
<travis-ci> crystal-lang/crystal#3086419 (master - Fix incorrect type for lib extern static array): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/338958229
greengriminal has joined #crystal-lang
<FromGitter> <faustinoaq> > hi, just wondering if anyone has used scry with vim? how was it? is there any special setup I need to do to use it? ⏎ ⏎ jnyw, yeah, I used it and works as expected, you first need the lsp-plugin installed and then specifies scry ⏎ ⏎ nvim (http://i.imgur.com/hCWLtg9.png "nvim but also works on vim") ... [https://gitter.im/crystal-lang/crystal?at=5a7c4e5f7dcd63481f33bbb6]
paleorange_h has joined #crystal-lang
hightower4 has quit [Ping timeout: 240 seconds]
<FromGitter> <j8r> paleorange, I think that the "procedural-functional style coders out there" will rather choose another language better designed for this paradigm than using a non standard PHP. This is not that hard to learn another language and web architecture, and it worth it
<paleorange> no other language will compile to php
<paleorange> no other language has the same amount of packages and such large community as php
<FromGitter> <j8r> why compile to PHP? You have to use legacy code with prodecural functional paradigms?!
<FromGitter> <j8r> Node.js, Java and Ruby match PHP
<FromGitter> <j8r> Python also
<paleorange> i have __common__ language that is accepted in __majority__ of place by the __majority__ of the servers
<FromGitter> <j8r> The point is, your subset and implementation probably won't
<paleorange> node.js shouldn't exist, js is for the browser; Java is enterprise; Python for web is...wierd
<paleorange> true but they at least should be compatible
<paleorange> like crystal and ruby
<Papierkorb> They won't be
<Papierkorb> Crystal isn't a subset from ruby or the other way around
<paleorange> it's superset
<Papierkorb> They're not compatible in the general case
<Papierkorb> No.
<FromGitter> <faustinoaq> paleorange, hey there's a couple of languages written in crystal check https://github.com/veelenga/awesome-crystal#implementationscompilers . Perhaps you can take inspiration from here :)
<FromGitter> <faustinoaq> Why not? :)
<paleorange> oh wait
<paleorange> here you go http://mammouth.boutglay.com/
<paleorange> almost like this
<paleorange> keyword is almost __almost__
<dragonkh> hi - I'm still struggling with Cipher - I don't understand what output it is giving me: OpenSSL::Cipher.new("aes-128-gcm") - just gives me "\xEC$\u001f\fF" - I was expecting a string similar to AES encryption in other languages such as javascript which is: "U2FsdGVkX1/T2E7cm5wm4vCvKMMHCoJiWTDqAxBI0RU="
<Papierkorb> the latter is base64, that's not the output of a cypher but an encoding of the output
<FromGitter> <faustinoaq> > Ubuntu 16.04 latest crystal 0.24.1 LLVM: 4.0.0 ⏎ ⏎ @coderhs Did you solved your issue? These versions look ok for me
<FromGitter> <coderhs> Not in this system, compiled in another system and now running well here.
<FromGitter> <coderhs> but this system right now is unusable, I am planning to reinstall everything again and see
<FromGitter> <faustinoaq> 👍
<dragonkh> Papierkorb - ok thanks -
<FromGitter> <straight-shoota> paleorange what's the point in chosing PHP for having a large community, many packages and server support? That won't matter much for a reduced subset of PHP.
<paleorange> that will, because it should be compatible in the same ol' places except oop
<paleorange> it means same non-oop tutorials, packages and what not will apply
<Papierkorb> You'll also have to implement the complete stdlib to be compatible. that's where the work will be.
<paleorange> and same ol'd apache and nginx should run it
<Papierkorb> PHP has a notoriously whack stdlib with many edge cases undocumented, but relied upon by software.
<Papierkorb> PHPs stdlib is even worse than that of JS
<paleorange> true JS is ES4/5
<Papierkorb> At least the latters one is documented
<Papierkorb> for all versions of ES
<paleorange> and it probably shall be called Ph
<FromGitter> <straight-shoota> and PHP has a standard implementation whereas JS does not
<paleorange> btw, do you have pip arpeggio-like yet?
<dragonkh> PapierKorb - there doesn't seem to be a way to supply a password on the Crystal cipher - in fact it doesn't work how I expected - it's not clear to me how I would AES (aes-256) encrypt the string "hello" with the password "password"
<dragonkh> in javascript I just have to do this: cryptojs.AES.encrypt("hello", "password")
<Papierkorb> Never used OpenSSL directly myself, after seeing how awful the API is I stayed away from it
<Papierkorb> Isn't there a crystal binding to nacl or something?
<Papierkorb> What are you encrypting?
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
<dragonkh> I'm trying to encrypt some json
<Papierkorb> Why?
<dragonkh> but I want it to be encrypted the same way in javascript and crystal
<dragonkh> it's a blockchain wallet
<dragonkh> so when the wallet is generated in crystal I want to encrypt it the same way as if the wallet is generated in javascript
<Papierkorb> There's probably a cheatsheet somewhere that shows how cryptojs API translates to other libs
<dragonkh> but if I can't do this - then maybe I will make crystal do a command line openssl thing instead
<Papierkorb> Though you really want to check if there's not already a wrapper for a better crypto lib than openssl
greengriminal has quit [Client Quit]
<Papierkorb> I'd only use the base64 encoding for transfer if the transfer protocol only works with latin1, not for storage.
paleorange has quit [Ping timeout: 260 seconds]
rohitpaulk has quit [Ping timeout: 260 seconds]
<FromGitter> <faustinoaq> dragonkh, check this: https://tio.run/##tZHBSsQwEIbveYohpxZ2K3qSggcRD8LKHvoAEpMpBtMkm6SUPH1NaxoKrjc9zj8zX/4/w130gal5dngZpUOgxqL2Xt1waT/QUUIGI0aF8PjcEQCBPXhUfYOau2hDJVhgB7DM@8k4UacRgO9VeIBzYnXdqW2fVqXROFWUoT/e3t0f@Tun@/kNuZc@MSbMRl870iTl5dy2rzgYFxdm1pvJyYBVXh1tsoarv7q@OtFLzVRpBfPmleSYatSC7LMK/POsGfkzKx0isAm9GbC8RP89eA69Bs9nQJGeS0cvl947W@D0cN1sTYi1UChrtXC2XyydX/fn@Qs
<FromGitter> <faustinoaq> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a7c5ad1f283b8e5463719a5]
duane has joined #crystal-lang
<FromGitter> <faustinoaq> https://tio.run/##xZHBSsUwEEX3@Yohqxbeq@hKCi5EXAjKW/QDJCa3GEybmLSUfn1NY1q60J3gcu7MnJk7I/0cBmGWxeNz1B7ErUMfgrmS2r3Dc8Y6q0YDun9sGJFCSwGmrdBLP7uhUGIQJ3IihMl6VcYSou9WuqNLZDXNc10/JKXqMRVcIJyvb27P8k3yY/2GPEofmCNmo6eMtlF5utT1Czrr55WZ9WryekCRW0cXV0Paryx/rGh1L8yeGuxrMFoixugVO3pV@HOvGfmPXrPP5DVfHiqOi3/en8u7mcSEYDvQCucnOkrbrtEac452SopWzna4PfNr/7J8AQ
rohitpaulk has joined #crystal-lang
greengriminal has joined #crystal-lang
danielpclark has quit [Ping timeout: 240 seconds]
danielpclark has joined #crystal-lang
willamin has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
faustinoaq has quit [Ping timeout: 252 seconds]
rohitpaulk has quit [Ping timeout: 255 seconds]
greengriminal has quit [Quit: Leaving]
rohitpaulk has joined #crystal-lang
snsei has joined #crystal-lang
LastWhisper____ has joined #crystal-lang
faustinoaq has joined #crystal-lang
Ven`` has joined #crystal-lang
<FromGitter> <alehander42> @paleorange , php is the last language you want if you want functional style, nowadays at least 5-6 languages have great web ecosystems and the server thing is also meh (for any significant project, you can use whatever stack you want in a normal cloud/your own server, 2002 era shared hosts are not important)
<FromGitter> <alehander42> it's a waste of time to base a language on it (and even if you do, it doesn't have to be a subset, it can just target php)
<FromGitter> <alehander42> (trust me, I've been there, written a simple minilang compling to php years ago for uni projects, not worth it)
<FromGitter> <j8r> conclusion: just write crystal, that's why we are here in the first place :-)
snsei has quit [Remote host closed the connection]
rohitpaulk has quit [Ping timeout: 240 seconds]
<paleorange_h> "nowaday languages" are not designed for web only, they are designed to be universal
snsei has joined #crystal-lang
<paleorange_h> nowadays*
<FromGitter> <j8r> why not write Vue.js, and a REST api, like every modern homo sapiens?
<FromGitter> <j8r> simple
snsei has quit [Remote host closed the connection]
<FromGitter> <faustinoaq> @j8r What about GraphQL? 😉
<FromGitter> <j8r> Yeah! Also, grpc, ghaphql or rest (but no soap), any API backend
<FromGitter> <straight-shoota> now this is becoming silly
<FromGitter> <straight-shoota> suggesting client side javascript + rest API when someone looks for a procedural server language
Ven`` has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
<FromGitter> <j8r> a web language for the browser I've read
<FromGitter> <j8r> But we are talking about web architecture to generate dynamic pages, it's not out of context
danielpclark has quit [Quit: Leaving]
<paleorange_h> yeah, with php you can fit what you need in 1 .php file and be done with it
<paleorange_h> despite it being super wrong
<FromGitter> <faustinoaq> @j8r Oh, I didn't know about grp, it looks very nice, Thank you for sharing!
<FromGitter> <alehander42> @paleorange_h and in real world web apps, 0.5% can be expressed in one file (except if you want to smash spaghetti code 5000 lines in a file)
<FromGitter> <j8r> that's the main problem of the architecture, its perfect for little projects, but for big ones 💀
<FromGitter> <alehander42> and in a lot of mini-frameworks in other languages, you can still make a little project in only 1-2 files
<FromGitter> <j8r> totally, but IMHO php is perfectly adapted for this, because designed specially for
snsei has quit [Remote host closed the connection]
imonmyown has joined #crystal-lang
<imonmyown> Papierkorb are you here?
<paleorange_h> php can do just fine without any frameworks
<FromGitter> <alehander42> @paleorange_h you're right, a framework can't fix php (or python , ruby and js)'s inherent problems
<FromGitter> <faustinoaq> > php can do just fine without any frameworks ⏎ ⏎ paleorange_h Crystal too, and without any server ⏎ ⏎ lol [https://gitter.im/crystal-lang/crystal?at=5a7c749b4a6b0dd32ba6c29a]
<FromGitter> <faustinoaq> Just Crystal+ECR ⏎ ⏎ and ECR is available on stdlib 😉
<FromGitter> <faustinoaq> *any external server
<paleorange_h> crystal is universal and not solely designed for web
<paleorange_h> and also raw
<FromGitter> <faustinoaq> All crystal-raw tests are made using just crystal and some db dependencies
<paleorange_h> 8080 is wrong
<paleorange_h> just use 80
<FromGitter> <faustinoaq> Is just a TFB requirement I think
snsei has joined #crystal-lang
faustinoaq has quit [Read error: Connection reset by peer]
faustinoaq has joined #crystal-lang
<dragonkh> faustinoaq - great thank :) exactly what I needed
snsei has quit [Ping timeout: 260 seconds]
<FromGitter> <j8r> I don't remember, is it better to use `YAML.parse` or `.to_yaml`?
qard has joined #crystal-lang
qard has quit [Client Quit]
<paleorange_h> so...after all that do you have any tutorials and tools that'll fit
qard has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
imonmyown has quit [Ping timeout: 260 seconds]
<faustinoaq> paleorange_h, crystal lang is pretty new, I think you can find some guides/tutorials in reddit/blogs/github, I don't promise you much though
faustinoaq has quit [Quit: IRC client terminated!]
imonmyown has joined #crystal-lang
<paleorange_h> so that's a "no", i presume
<FromGitter> <straight-shoota> tutorial for what exactly?
<FromGitter> <straight-shoota> writing a PHP interpreter?
imonmyown has quit [Ping timeout: 260 seconds]
<paleorange_h> yes
<paleorange_h> (from scratch)
<FromGitter> <straight-shoota> there are general tutorials like on parsing and lexing, but I don't know anything specific about PHP or for Crystal
<FromGitter> <straight-shoota> But it might be a good place to start with looking at other implementations
<FromGitter> <straight-shoota> there exist quite a few interpreters for different languages written in Crystal
<paleorange_h> any lexer/parser generators?
mrMelonMen has joined #crystal-lang
faustinoaq has joined #crystal-lang
mrMelonMen has quit [Quit: Page closed]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
LastWhisper____ has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <r00ster91> are there good web GUI frameworks for crystal? I couldnt really find any. I also looked in Kemal for any GUI stuff but its not having anything like that.
<FromGitter> <straight-shoota> paleoroange_h, I remember seeing a parser generator somewhere, but I can't remember
<FromGitter> <straight-shoota> what is was called
<FromGitter> <straight-shoota> @r00ster91 what do you mean with web GUI framework?
duane has joined #crystal-lang
<FromGitter> <r00ster91> I meant something where you can litteraly "generate" html. Like for example display images, input fields, just normal text etc and all this stuff. Without that you need to write real HTML
<Papierkorb> Do you have an example what you mean? The only thing that actually did that was Wt ("Witty") for C++
<Papierkorb> (With all of its practical shortcomings, darn was it cool to build stuff with it)
<Papierkorb> There are a few templating engines at this point if you mean that, ranging from "basically HTML" with ECR to stuff that's akin to Slim (If you did Ruby)
<FromGitter> <r00ster91> for example in kemal you can do ⏎ get "/" do ⏎ "Hello World!" ⏎ end ⏎ and then it displays hello world. But I imagine some framework where you can do something this: ... [https://gitter.im/crystal-lang/crystal?at=5a7c92324a6b0dd32ba790c3]
<FromGitter> <r00ster91> so you dont need to write HTML there
<Papierkorb> Have a look at the available templating engines. They safe you from having to write real HTML without sacrificing its capabilities too much.
<Yxhuvud> I have a parser generator but it is not ready to use yet.
<paleorange_h> aww
<paleorange_h> is it better than pip arpeggio?
<FromGitter> <r00ster91> i think I will just do my own parser thingy then
vivus has joined #crystal-lang
<FromGitter> <faustinoaq> paleorange_h, Wow https://www.peachpie.io/ PHP on .Net :D
<paleorange_h> nah
<FromGitter> <faustinoaq> Looks promising
<FromGitter> <stevensonmt> Having an issue with kemal rendering page using params after POST action. ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ In the `index.ecr` file I have a reference to `selected_drugs` which creates an unrecognized local variable error. Any suggestions? [https://gitter.im/crystal-lang/crystal?at=5a7c988293be87284d9227dd]
t4nkf33der has joined #crystal-lang
railgun has joined #crystal-lang
faustinoaq has quit [Ping timeout: 268 seconds]
<FromGitter> <sdogruyol> What if you don't have that param? It would be nil and won't set the variable
andersh has quit [Ping timeout: 276 seconds]
<paleorange_h> guys..?
andersh has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 265 seconds]
<FromGitter> <stevensonmt> @sdogruyol `index.ecr` checks for nil to determine whether to display a certain component. It works in sinatra. Does crystal not allow nil values?
DTZUZO has quit [Ping timeout: 260 seconds]
t4nkf33der has left #crystal-lang [#crystal-lang]
hightower4 has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <stevensonmt> I wonder if the issue is not setting the value for the variable in the `get` route as it uses the same `index.ecr` for the view. I'll have to try that when I get home.
Poeticode is now known as Poeticold
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
<FromGitter> <stevensonmt> @r00ster91 have you checked into https://github.com/crystal-lang/html_builder
<FromGitter> <stevensonmt> or https://github.com/f/temel
<FromGitter> <elorest> This gitter channel is a great place to find help but it would probably be better to encourage people to open a question on stack overflow and then post it here. This will be really good for drawing attention to the crystal language.
<FromGitter> <elorest> Also answers would then be indexed so they don't have to be asked over and over again in chat.
<Papierkorb> We don't need a SO post glossary, there's already Google Search for that.
<Papierkorb> I'm not even reading such posts. Most drop off a link to something and expect people to respond to that. Super rude if you ask me
<Papierkorb> imonmyown, if you're here, I'm now
<FromGitter> <imonmyown> @Papierkorb cool
railgun has quit [Ping timeout: 248 seconds]
<paleorange_h> sigh :(
qard has joined #crystal-lang
<FromGitter> <imonmyown> @Papierkorb did you get any PM on irc?
imonmyown has joined #crystal-lang
<Papierkorb> imonmyown, I didn't in the last 10 mins, though I just rebooted, have you tried it in the last few secs?
<FromGitter> <imonmyown> retrying
alex`` has quit [Ping timeout: 255 seconds]
duane has quit [Ping timeout: 255 seconds]
duane has joined #crystal-lang
rohitpaulk has joined #crystal-lang
faustinoaq has joined #crystal-lang
duane has quit [Ping timeout: 256 seconds]
duane has joined #crystal-lang
faustinoaq has quit [Ping timeout: 248 seconds]
rohitpaulk has quit [Ping timeout: 256 seconds]
duane has quit [Ping timeout: 248 seconds]
greengriminal has joined #crystal-lang
kektrain___ has joined #crystal-lang
kektrain___ has left #crystal-lang ["iяс.sцреяиетs.ояg сни sцреявоwl"]
<FromGitter> <asterite> @stevensonmt I'm sure it's because the var is not set in all routes that uses that view
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
imonmyown has quit [Ping timeout: 260 seconds]
<hightower4> Hey folks, I just realized something. If I run "puts MyClass.class; require "myclass"", this works even though I would assume that "MyClass" wouldn't exist in the first line because "require" which defines it hasn't been called yet
<hightower4> What's the trick there?
<jsn-> "require" is not really a statement, afaics, it's a keyword, handled in parser
<hightower4> jsn-, yes, but if I do "puts :before; require "myfile"; puts :after", and if in myfile.cr I put "puts :in_between", this will print "before, in_between, after"
<hightower4> Which seems to indicate that code in require executes at place of occurrence, together with regular program flow
<jsn-> well, main blocks in required file, if there are any, may be called later, but the declarations are probably processed immediately
<jsn-> (i'm just guessing though, sorry, since no authoritative sources of knowledge seem to be available at the moment)
<hightower4> Yes but it's not that simple. Even variables initialized during "require" are visible and fully initialized in the line before require. Let me try to come up with a reproducible example