<FromGitter>
<randiaz95> George! How are you feeling? Anyone you know got the COVID?
<FromGitter>
<Blacksmoke16> nope
<FromGitter>
<randiaz95> i dont know one case either...
<FromGitter>
<randiaz95> Either we over reacted or.... We are doing a good job
<FromGitter>
<tenebrousedge> even in the worst case scenario, most people won't know anyone who gets it
<FromGitter>
<randiaz95> why?
<FromGitter>
<randiaz95> When you get it do you get kidnapped or something?
<FromGitter>
<randiaz95> That would make for a fun movie
<FromGitter>
<tenebrousedge> just statistics. There are 328 million people in the US, and it's expected that a few million people will get this disease. How many people do you keep in regular contact with?
<FromGitter>
<Blacksmoke16> like 2
<FromGitter>
<Blacksmoke16> :S
<FromGitter>
<tenebrousedge> so if you keep in contact with 2 people, something like 100 million would have to get the disease before it's likely that someone you keep in contact with would have it
ur5us has joined #crystal-lang
<FromGitter>
<tenebrousedge> also, part of the reason that this is dangerous is because many people only have mild symptoms and don't know that they have it
zorp_ has joined #crystal-lang
<FromGitter>
<randiaz95> Or also possible that all your friends die
<FromGitter>
<randiaz95> given we have such few friends
<FromGitter>
<Blacksmoke16> my friends are nerds so i doubt they going anywhere either ha
<FromGitter>
<randiaz95> but.. under the condition that we code and stay inside often. We most likely won't get it
<FromGitter>
<randiaz95> Nerd is a derogative term
<FromGitter>
<randiaz95> I like to use Intellectually superior
<FromGitter>
<Blacksmoke16> naw they're nerds :D
<FromGitter>
<tenebrousedge> I spent like 8 months doing the social isolation thing, but I started being socially active just about when this outbreak started :/ doing it wrong
<FromGitter>
<Blacksmoke16> i wish compile time errors in custom macros were more helpful
<FromGitter>
<watzon> @randiaz95 might be worth looking into Lucky too
<FromGitter>
<Blacksmoke16> coughathenacough
<FromGitter>
<watzon> Athena is good too, if you're looking for API only
<FromGitter>
<Blacksmoke16> it can handle HTML now
<FromGitter>
<watzon> Lucky is the most fully featured framework in Crystal as of right now though
<FromGitter>
<watzon> Oh that's cool
<FromGitter>
<Blacksmoke16> granted i cant say i tested it much tho, but its theoretically doable ha
<FromGitter>
<Blacksmoke16> at least the unit tests pass
<FromGitter>
<Blacksmoke16> id agree with that
<FromGitter>
<randiaz95> Hahah, I kinda am in cli mode; if I change my mind I will go to George's framework; ⏎ ⏎ ( If stripe gets built in api into Athena I will drop everything I am doing and incorporate a business and start building my dream application )
<FromGitter>
<randiaz95> I will kidnap my sophmore cousin for forced labor
<FromGitter>
<Blacksmoke16> amber for making a cli?
<FromGitter>
<randiaz95> amber uses cli commands to make apis
<FromGitter>
<randiaz95> like rails
<FromGitter>
<watzon> Lucky does as well
<FromGitter>
<Blacksmoke16> ah, like generating the files?
<FromGitter>
<randiaz95> Yep
<FromGitter>
<Blacksmoke16> gotcha
<FromGitter>
<watzon> Personally I love Lucky because of Avram. It's the sanest ORM I've found so far.
<FromGitter>
<watzon> Granite is a close second.
<FromGitter>
<Blacksmoke16> granite is only one that supports annotations afaik
<FromGitter>
<watzon> The only downside is being locked to Postgres, but since I use it anyway that isn't much of a downside
<FromGitter>
<Blacksmoke16> pg ftw
<FromGitter>
<randiaz95> postgres <3
<FromGitter>
<randiaz95> Omg lol we all like postgres?
<FromGitter>
<randiaz95> I've done every exercise on this site
<FromGitter>
<randiaz95> my first job was with pgsql
<FromGitter>
<tenebrousedge> what's not to like about pg?
<FromGitter>
<randiaz95> for geo data
<FromGitter>
<watzon> Anyone that disagrees that postgres is the best SQL database can fight me
<FromGitter>
<randiaz95> lol
<FromGitter>
<watzon> It simply is
<FromGitter>
<randiaz95> they will get jumped bro
<FromGitter>
<randiaz95> specially in this channel
<FromGitter>
<randiaz95> sadly i've been using sqlite for learning amber; due to the fact that I don't know where to put my pgsql link
<FromGitter>
<randiaz95> also GUYS OMG
<FromGitter>
<watzon> I feel like anyone coming from Ruby probably appreciates Postgres, since it's recommended by Rails
<FromGitter>
<randiaz95> use elephantsql.com
<FromGitter>
<randiaz95> for free small db
<FromGitter>
<randiaz95> 20 mb
<FromGitter>
<randiaz95> I made an account for a dashboard I made when I was consulting
<FromGitter>
<randiaz95> if it ever passes 20 mb it just deletes the oldest rows
<FromGitter>
<randiaz95> in the api I made.
<FromGitter>
<elorest> @watzon ⏎ Lucky is a great framework and solves some problems in a different way than Amber. I don't thinks it's objectively true to claim one is more full featured than the other. In both cases the design decisions were deliberate and took a lot of effort. ⏎ ⏎ Both the Amber and Lucky teams are huge fans of crystal in general and are doing their best to draw people to crystal be creating tools that
<FromGitter>
... are easy to use and bring people from Rails, Phoenix, Spring etc. In the case of Amber many decisions were also made in an eat your own dog food sort of way and is used in a few large projects. [https://gitter.im/crystal-lang/crystal?at=5e9a6b8263e7b73a5fe54add]
<FromGitter>
<watzon> My main problem with Amber is that they do things more "the Ruby way" than "the Crystal way", and the tooling isn't great when compared with Lucky. It's still a good framework, but I wouldn't put it in the same category.
<FromGitter>
<watzon> Lucky also has the backing of Thought Bot
<FromGitter>
<elorest> Paul the creator worked for Thoughtbot and created it during innovation time but it wasn't really backed by them. Paul works for github now.
<FromGitter>
<Blacksmoke16> i cant imagine the complexity both of those frameworks must have
<FromGitter>
<watzon> Fair
<FromGitter>
<watzon> They're both very complex
<FromGitter>
<watzon> I know of someone getting ready to use Lucky for a very large production project
<FromGitter>
<elorest> I know of a least one production project in Lucky and a couple in Amber.
<FromGitter>
<elorest> I was an original member of the Amber core team so might be a bit biased, but and I'll admit we intentionally built things as a hybrid between Rails and Phoenix frameworks.
ur5us has quit [Ping timeout: 265 seconds]
<FromGitter>
<elorest> Most of us loved haml and then slim-lang in ruby and dru and I have been using rails since 2005 but have a background in C.
<FromGitter>
<elorest> Most of the advance functionality works best in slang which we helped to move toward feature completeness with slim.
<FromGitter>
<randiaz95> Which has the easiest and safest auth for api services?
<FromGitter>
<watzon> I mainly just like how well Lucky uses Crystal to the best of its ability. I like Amber too, but I've gotten very accustomed to Lucky's fresh take on web frameworks. For instance, the way it uses Crystal for building HTML rather than a templating framework that just adds a special syntax on top of HTML.
<FromGitter>
<randiaz95> gah.. I am going to learn lucky now lol
<FromGitter>
<randiaz95> I just saw that too; I must use slang
<FromGitter>
<watzon> @randiaz95 that's a pretty loaded question lol
<FromGitter>
<randiaz95> plus the cli autocode doesn't let me automatically send json
<FromGitter>
<elorest> When Paul was getting started on Lucky we had multiple discussions to about joining forces but ultimates our goals for DSLs were too different. We both agreed however that finding and preventing errors at compile time was of utmost priority.
<FromGitter>
<watzon> Yeah that's the major thing imo
<FromGitter>
<watzon> Crystal gives you that ability, why not use it
<FromGitter>
<elorest> Exactly.
<FromGitter>
<Blacksmoke16> how does lucky handle action arguments?
<FromGitter>
<Blacksmoke16> like `/user/:id`
<FromGitter>
<tenebrousedge> hmmm. I tend to prefer template languages to DSLs
<FromGitter>
<Blacksmoke16> like do you get `id` as a string or?
<FromGitter>
<Blacksmoke16> i mean ideally you wouldn't have 1 controller with everything in it
<FromGitter>
<randiaz95> I've been using that as a template for each controller
<FromGitter>
<Blacksmoke16> they should be grouped by type, `UserController` has CRUD for users etc
<FromGitter>
<watzon> Yeah one of the things I like about Lucky is they really take separation of concerns to a new level
<FromGitter>
<watzon> It's hard to wrap your brain around at first, but I ended up loving it
<FromGitter>
<Blacksmoke16> also depends on what dependencies the controller has
<FromGitter>
<Blacksmoke16> deff a diff approach versus lucky ha
<FromGitter>
<Blacksmoke16> theres some cool stuff you can do with DI
<FromGitter>
<elorest> Architecturally neither is right or wrong and has many design patterns to back it up. It was actually quite a bit of work to pull that off.
<FromGitter>
<Blacksmoke16> but basic usages dont require it
<FromGitter>
<Blacksmoke16> i could imagine
<FromGitter>
<elorest> It works well with the concept of CRUD though.
<FromGitter>
<elorest> Kemelyst which was a precursure to Amber also had a single class per action.
<FromGitter>
<Blacksmoke16> the main things im most proud about athena is how actions are just methods, and controllers are just classes. makes it super easy to test, document, understand what's going on
<FromGitter>
<elorest> Yeah I like that design.
<FromGitter>
<Blacksmoke16> esp when paired with DI and use interfaces, to supply dependencies
<FromGitter>
<Blacksmoke16> easy to make test implementations of those to use, or to swap out functionality with a 1 or 2 line change
<FromGitter>
<randiaz95> So, why do all the big http server libraries in crystal all worry about openssl? I usually deploy with nginx/openssl setup in front of my apis
<FromGitter>
<watzon> What do you mean "worry about"?
<FromGitter>
<elorest> It's handy to have tls sometimes without setting up nginx in front of it on raspberry pi or something. At Nikola Motor we're running on a lot of embedded systems in vehicles and still value encryption, but don't need the overhead or advanced functionality of nginx.
<FromGitter>
<watzon> It seems to be having an issue with the instance variable being accessed from within a proc that's assigned to a class variable being passed into a C closure
<FromGitter>
<randiaz95> I meant it physically lol it is a little difficult to understand
<FromGitter>
<Blacksmoke16> https://athena-framework.github.io/athena/Athena/EventDispatcher/EventListenerInterface.html ⏎ ⏎ > Implementors must also define self.subscribed_events : AED::SubscribedEvents that represents the events that self's methods are listening on. The value of the hash is the priority of the listener. The higher the value the sooner that listener method gets executed.
<FromGitter>
<Blacksmoke16> essentially says "this class is listening on the Response event"
<FromGitter>
<Blacksmoke16> and its its compression that should happen after all the other response listeners in case they changed the content of the response themselves
<FromGitter>
<Blacksmoke16> since its*
<FromGitter>
<watzon> I wonder if it's the `h.value.data.as(Area*)` part causing the problem
<FromGitter>
<Blacksmoke16> what if you make it as the child type
<FromGitter>
<Blacksmoke16> since it would have an extra ivar, thus be bigger, thus not allocate the right memory?
<FromGitter>
<watzon> Yeah I think that's the issue
<FromGitter>
<watzon> The question is how to fix it
<FromGitter>
<Blacksmoke16> define them in`macro inherited` and use `{{@type}}`?
<FromGitter>
<watzon> Thought about that
<FromGitter>
<watzon> Let's try
<FromGitter>
<watzon> Unfortunately no
<FromGitter>
<Blacksmoke16> Awe
nowhereFast has joined #crystal-lang
ur5us has joined #crystal-lang
<nowhereFast>
I'm using abstract def's in modules which are explict about return types, the compiler warns that we'll have to be explict about return types in the concrete implementation too in future, considering that my use of modules in this manner somewhat resembles an interface, what is the preferred way of specifying return types in Crystal?
<FromGitter>
<Blacksmoke16> You just need to specify that type return in the implementation
<FromGitter>
<Blacksmoke16> So it matches the abstract defs
<nowhereFast>
taking the case of `abstract def foo(x : Thing) : OtherThing`, for reasons of wanting the return type in the contract, I would have to be explict about the return type in the implementation too, but would not have to be explicit about the type of the arg?
<FromGitter>
<Blacksmoke16> i.e. being able to do `def foo (x) : OtherThing` in the implementation?
<nowhereFast>
that works, but ommiting the return type from the implementation causes the compiler to complain. My question is more from a place of 'what is idiomatic Crystal in this case'.
<FromGitter>
<Blacksmoke16> as the warning says, `add an explicit return type (String or a subtype of it) to this method as well`
<FromGitter>
<Blacksmoke16> tl;dr child method should be pretty much the same as the parent
<nowhereFast>
I see, so; be explict about return types and args irrespective of what has been specified in the interface.
<FromGitter>
<Blacksmoke16> to be clear thats how the abstract def implementation works
<FromGitter>
<Blacksmoke16> by making sure the child has the same return type as the interface, hence the error
<FromGitter>
<Blacksmoke16> warning*
<FromGitter>
<Blacksmoke16> you would still get a compile time warning even if you didnt have the abstract def, but i like them for documentation and such
<FromGitter>
<Blacksmoke16> also iirc if the parent method is like `abstract def foo(x : Int32 | String) : Bool`
<FromGitter>
<Blacksmoke16> then the child could be one method with a union type arg, or two separate methods restricted to one of the types
<FromGitter>
<Blacksmoke16> nvm, thats not a thing
<FromGitter>
<tenebrousedge> <__<
<FromGitter>
<Blacksmoke16> could of swore that was working for me at some point
<nowhereFast>
thanks, I was aiming for being specific in the interface, and letting inference do its thing for the implementation.
<FromGitter>
<tenebrousedge> apparently the compiler doesn't like that
<FromGitter>
<Blacksmoke16> have the match return type at least
<FromGitter>
<tenebrousedge> which presumably means that it's hard for it to figure out
<FromGitter>
<Blacksmoke16> but i try to use types where i can, just makes things more clear and improves the generated docs
<nowhereFast>
> but i try to use types where i can, just makes things more clear and improves the generated docs
<nowhereFast>
^this is what I was looking for.
* FromGitter
* tenebrousedge eats all the types
<FromGitter>
<tenebrousedge> fixed it
<FromGitter>
<Blacksmoke16> you can also do `def foo(x : _)` i.e. essentially being explicit about this method being able to accept any type
<FromGitter>
<Blacksmoke16> same as `def foo(x)`
<FromGitter>
<randiaz95> wow its so nice to have front end autorefresh and backend autorefresh set up
<FromGitter>
<randiaz95> fresh template for new projects on monday
<FromGitter>
<randiaz95> ima see if i make something cool today
<FromGitter>
<randiaz95> Talk tomorrow!!
<FromGitter>
<tenebrousedge> react :/
<FromGitter>
<randiaz95> :')
<FromGitter>
<randiaz95> I hate compiling my code so dart/typescript is uncomfortable for me
<FromGitter>
<randiaz95> plus i invested in learning vanilla JS
<FromGitter>
<Blacksmoke16> imma head to bed myself. @randiaz95 any questions/suggestions/issues with Athena let me know. I'd be happy to talk over architecture as well since its a bit diff than other frameworks
<FromGitter>
<randiaz95> George I'll let you know
<FromGitter>
<Blacksmoke16> > I hate compiling my code ⏎ yet you use crystal :P
<nowhereFast>
:-)
<FromGitter>
<Blacksmoke16> 👍 sounds good, o/
<FromGitter>
<randiaz95> lol
<FromGitter>
<randiaz95> hate compiling JS
<FromGitter>
<randiaz95> didn't specify what, I love compiling exec files for systemd services
<FromGitter>
<tenebrousedge> svelte is nice though
<FromGitter>
<tenebrousedge> probably also elm
<FromGitter>
<randiaz95> Can't manipulate the DOM through a tertiary language into JS
<FromGitter>
<randiaz95> my head hurts just thinking about it
<FromGitter>
<tenebrousedge> check out svelte though
<nowhereFast>
took a quick look at Svelte earlier in the week, it does look nice
<nowhereFast>
I like the direction it's taken, looks like Vue 3 will be doing similar things.
ur5us has quit [Ping timeout: 246 seconds]
ua has quit [Ping timeout: 256 seconds]
ua has joined #crystal-lang
_whitelogger has joined #crystal-lang
_ht has joined #crystal-lang
<oprypin>
watzon, hey i still havent seen the struct wherre you added the data field :p
<oprypin>
please publish a repro or just all the code and let's see
renich has joined #crystal-lang
<renich>
Good time_of_day to you!
<renich>
I was wondering, I have a bunch of jekyll files I want to parse. They have a yaml-like header. It starts with '---' and ends with '---'. I want to match the stuff between these two. With gawk, I could just: `gawk '/---/,/---/{i++}i==1'` and that would work. How do I do this in Crystal?
<renich>
sed also works: `sed '/---/,/---/p' somefile`
<oprypin>
i literally download that exe and run it the same way locally and it works
<FromGitter>
<tenebrousedge> it wants blood :E
<FromGitter>
<stronny> do you need `.\`?
<FromGitter>
<ImAHopelessDev_gitlab> wait, there is a slack now?
<FromGitter>
<stronny> try running `dir`, maybe it isn't where you think it is
<oprypin>
stronny, yea powershell needs it
<FromGitter>
<tenebrousedge> @ImAHopelessDev_gitlab that is beyond our borders. You must never go there
<FromGitter>
<ImAHopelessDev_gitlab> lol
<oprypin>
ImAHopelessDev_gitlab, we cant lose you 😢
<oprypin>
ok i just literally copy pasted that whole ENV block and set the same variable values locally
<oprypin>
---------------------------crystal.exe - System Error---------------------------The code execution cannot proceed because LLVM-C.dll was not found. Reinstalling the program may fix this problem. ---------------------------OK ---------------------------
<FromGitter>
<ImAHopelessDev_gitlab> "crystal.exe" that's a first
<FromGitter>
<faustinoaq> I guess I'll keep using crystal 0.33.0 on my IoT project 😅
<FromGitter>
<Blacksmoke16> assuming crystal build on it (which its a tier 2 platform, id imagine it would), maybe a PR would be accepted to also build one for that arch in snap
<FromGitter>
<ImAHopelessDev_gitlab> easy, just right click, inspect element. *taps head*
<FromGitter>
<tenebrousedge> I was wondering that too oprypin
<oprypin>
tenebrousedge, stiill no idea
<hightower2>
oprypin, stronny: how did you envision that string-from-string from the other day would actually be used to create two strings sharing the same bytes? Based on your suggestions, I can now manipulate string header to affect the size of string as crystal sees it (this doesn't insert \0), and through a pointer I can also set some byte to 0. But, how to actually create a new String object? All constructors I've found for String do copy
<hightower2>
the bytes (i.e. String.new(Bytes) and String.new(Pointer(UInt8)))
<oprypin>
hightower2, you cant and shouldnt
<oprypin>
you're modifying the old string so whats the point of creating a new object, just use the old one
<oprypin>
it can only be one kind of string at a time
<hightower2>
yes the whole question arised from the fact that various string search functions do not accept range within which to search (they at best include the starting offset, not the ending one)
<oprypin>
you modify the original string, do something with it, then modify it to something else, do something with it
<hightower2>
so my wish was to create resized strings using the same bytes, to pass to such functions as argument
<hightower2>
and as mentioned I could live with inserting \0 if/when need be
<oprypin>
hightower2, i don't understand what's the problem
<oprypin>
you have the modified string so just use it, what exactly makes it so you want to create a new String object (which you can't) that you can't do with the old modified one
<hightower2>
let's say I want to do a regex search within bytes 1000..1100 of a string (without using a regex rule to skip first 1000 chars, obviously)
<hightower2>
how would I do it? (and also without extracting a substring of the original string into the new one by copying the bytes)
<oprypin>
modify the header so it has bytesize 1100, then search with regex on that string starting from 1000
<oprypin>
or, well, append this to your regex `(?<=.{1000})`
<oprypin>
prepend*
<FromGitter>
<watzon> @oprypin sorry, what struct with data field?
<FromGitter>
<watzon> It's basically just a cross platform abstraction over existing UI libs
<oprypin>
what's the equivalent of `foo $(bar)` in powershell, god
<oprypin>
if i run that, it splits by newline, rather than any whitespace
<FromGitter>
<watzon> Lol I have no clue
<hightower2>
oprypin, sorry which one, strstr? Yes, I already use this to find the offsets of the text in which I want to search. But after that, I need to do a more flexible search within the identified region.
<hightower2>
oprypin, btw, so in Crystal's implementation for String the string bytes follow right after the header?
<FromGitter>
<stronny> @hightower2 I suugested you add a new constructor locally
<oprypin>
so you just alter bytesize and use normal operations on it
<FromGitter>
<stronny> it would be very unsafe so beware
<hightower2>
stronny yes, I was just thinking about this as I opened the source and looked into the implementations
<hightower2>
of the existing constructors
<hightower2>
but as oprypin confirms, if the bytes follow the header then it's not really possible either way..
<hightower2>
other than just playing with the existing one
<hightower2>
ok great, thanks
<oprypin>
yes i said that before multiple times, just didnt explain why
<FromGitter>
<stronny> what's not possible?
<oprypin>
have multiple different strings which point to the same data at the same time
<FromGitter>
<stronny> why not?
<hightower2>
right
<hightower2>
because the bytes follow the string header, there is no pointer pointing to the bytes
<hightower2>
so it's always the same string/same header
<FromGitter>
<stronny> you'll just have to have a larger patch :3
<hightower2>
indeed :-)
<oprypin>
hightower2, hey technically you can have it if the strings are non-overlapping and have 13 bytes gap between them ;p
<hightower2>
but actually ....
<hightower2>
I could write a class whose method to_unsafe returns the pointer of the other string's bytes :)
<oprypin>
uuuuu
<FromGitter>
<stronny> yes, why does it have to be a String?
<hightower2>
well, yes.. .maybe convenient though to subclass a String, simply because I do need it to behave as a string really
<hightower2>
and do need the string header which I can manipulate, etc.
<FromGitter>
<stronny> moreover, if you need some realtime shit with no allocations, Crystal is a wrong tool
<oprypin>
anyway got my answer. `foo $(bar)` seems to be the same as `eval "foo $(bar)"` which would be `Invoke-Expression "foo $(bar)"` in powershell
<FromGitter>
<stronny> covenient!
<FromGitter>
<stronny> you can't subclass String though =(
<oprypin>
^
<hightower2>
well... good point... but yeah, looks interesting even if not a subclass of string.. will develop the idea some more... thanks folks
<FromGitter>
<stronny> could you share some example code?
<FromGitter>
<stronny> what is the problem you are solving, at a high level
<hightower2>
At a high level, I have a bunch of text through which I want to scan/search for various things as fast as possible, while being able to set start and end positions for those searches (which can be anything, from String#index to regex matching etc.). So my idea was to use LibC functions since they're much faster and I just need pointers/offsets.
<hightower2>
But once I narrow down to specific sections (i.e. have the offsets), then I do need to run some regular finding/matching using regexes
<FromGitter>
<stronny> read the bytes into a Bytes, skip String altogether
<oprypin>
well this is basically forfeiting stdlib anywaya
<FromGitter>
<stronny> you can have regexps with LibPCRE directly
<hightower2>
yeah well, didn't want the whole code to look like C, but just wanted to replace those few functions which always run and need to be as fast as possible
<FromGitter>
<stronny> well it's up to you to come up with the right tradeoff
<FromGitter>
<stronny> low-level but with full control vs. higher level with some limitations
<hightower2>
it's a good point though, or future modification... calling LibC from Crystal is still so much nicer than C
<FromGitter>
<j8r> giving up with Godot @ImAHopelessDev_gitlab , can't get the C# project compiling under Godot
<oprypin>
c++ is nice these days 😂
<FromGitter>
<stronny> unity is c# right?
<FromGitter>
<j8r> maybe I will write in GDScript, and using C++ in some places where perf is needed
<oprypin>
stronny, yes
<FromGitter>
<stronny> well there you go
<FromGitter>
<j8r> anyone can recommend a game engine (3D)?
<FromGitter>
<j8r> "Easy", please :)
<FromGitter>
<watzon> Godot?
<FromGitter>
<stronny> I guess two most popular right now are unity and unreal
<FromGitter>
<watzon> Oh I missed the above
<FromGitter>
<watzon> Lol
<FromGitter>
<j8r> Open Source also
<FromGitter>
<watzon> I'd probably go Unity after Godot, but you're not going to find an open source engine as good as Godot
<FromGitter>
<j8r> I can take another shot using GDScript
<FromGitter>
<Blacksmoke16> that and reverse would be helpful
<FromGitter>
<stronny> so what's gonna happen if I type `partenr` instead of `partner`?
<FromGitter>
<Blacksmoke16> you'd wonder why that one was missing
<FromGitter>
<Blacksmoke16> not sure what i could do about that
<FromGitter>
<stronny> make it static
<FromGitter>
<Blacksmoke16> sec
<FromGitter>
<Blacksmoke16> mm would need a way to resolve a constant to its value in macro land
<FromGitter>
<Blacksmoke16> er actually
<FromGitter>
<stronny> `@[ADI::Register(3, "Yahoo", name: "yahoo", tags: [{name: "partner", priority: 10}])]` I would be bothered by this syntax
<FromGitter>
<Blacksmoke16> what would you rather?
<FromGitter>
<stronny> I would wish for something much simpler like `@[ADI::Partner(Yahoo: 10)]`
<FromGitter>
<Blacksmoke16> sure, but how would you do that :P
<FromGitter>
<stronny> hey, that's your job! =)
<FromGitter>
<Blacksmoke16> the first two arguments are for the constructor of the `FeedPartner` class
<FromGitter>
<Blacksmoke16> `name` is setting the name of the service
<FromGitter>
<Blacksmoke16> annotations can only be accessed by name so cant really just define your own type, plus would still need a way to pass the arguments
<FromGitter>
<Blacksmoke16> and it cant be `ADI::Tag` since it needs to be specific to a given service, not the class the service is created from
DTZUZU2 has joined #crystal-lang
<FromGitter>
<Blacksmoke16> so best you're going to get for now ha
<FromGitter>
<Blacksmoke16> idea is that the partner manager could be injected into a controller or something so you could do `GET /partners/2` and resolves to the `facebook` object
<FromGitter>
<Blacksmoke16> so to support additional partners you just add another annotation and it all just works
alexherbo21 has joined #crystal-lang
<FromGitter>
<stronny> after recompilation and redeployment
<FromGitter>
<Blacksmoke16> well yea
<FromGitter>
<stronny> instead if you store it in a config file or even database then you have it at runtime
<FromGitter>
<Blacksmoke16> that would be one way to do it
<FromGitter>
<Blacksmoke16> ofc this is also a simple example, feed partners could have dependencies of their own etc
<FromGitter>
<Blacksmoke16> in a real application i would make the names like `myapp_feeds_google` or `myapp_search_google`
alexherbo24 has joined #crystal-lang
<FromGitter>
<Blacksmoke16> same idea as namespacing code to prevent conflicts from diff shards
<FromGitter>
<stronny> okay.jpg
alexherbo2 has quit [Ping timeout: 256 seconds]
alexherbo24 is now known as alexherbo2
<FromGitter>
<Blacksmoke16> @randiaz95 it would just add another ivar/getter to the contaienr
<FromGitter>
<Blacksmoke16> since they're all based on the same class
<FromGitter>
<Blacksmoke16> but good call on the constants
<FromGitter>
<Blacksmoke16> be easier to document and such as well
<FromGitter>
<kingsleyh> hello does anyone know if there is any particular performance hit with converting things into a BigInt e.g. `BigInt.new(some_hex_string, 16)`
<FromGitter>
<stronny> I think you should profile yourself
<FromGitter>
<kingsleyh> @stronny what's the best way of profiling it
<FromGitter>
<kingsleyh> using Benchmark?
<FromGitter>
<stronny> that's one way
<FromGitter>
<stronny> another is linux's `perf`
<FromGitter>
<kingsleyh> thanks
<FromGitter>
<Blacksmoke16> fwiw you can also do `"3a060dbf8d1a5ac3e67bc8f18843fc48".to_big_i(16)`
<FromGitter>
<Blacksmoke16> does same thing you're doing, but just a bit cleaner
<FromGitter>
<kingsleyh> thanks
<FromGitter>
<stronny> that's just another syntax, shout be no diff in performance
<FromGitter>
<Blacksmoke16> right
<FromGitter>
<dscottboggs_gitlab> why is slice.size `Int32` instead of `LibC::SizeT`?????
<FromGitter>
<dscottboggs_gitlab> If there's no good reason for this I'm making a PR right now.
<FromGitter>
<stronny> Slice is Crystal type
<FromGitter>
<dscottboggs_gitlab> I should never have to worry about `Slice(T)#size` being negative, that makes no sense
<FromGitter>
<kingsleyh> I'm looking into this https://github.com/q9f/secp256k1.cr for SushiChain - but currently it's like 7000% slower than my openssl bindings
<FromGitter>
<stronny> that was already debated
<Stephie>
@dscottboggs_gitlab crystal never uses platform-dependent types outside of unsafe code
<FromGitter>
<dscottboggs_gitlab> @stronny why does that matter? The size of a pointer is architecture dependent and can never be negative.
<FromGitter>
<stronny> afair the argument for Int vs. UInt is you will have problems with math
<FromGitter>
<dscottboggs_gitlab> At the very least it should be `UInt32` since crystal doesn't support 16 or fewer-bit architectures
<Stephie>
Pointer#address is always UInt64 in crystal
<Stephie>
even on 32bit
<Stephie>
this is fundamental
<Stephie>
types do not change based on platform
<Stephie>
unless you are talking to C
<Stephie>
it will feel weird to you if you are a C programmer, but crystal is not designed for low-level work
<FromGitter>
<dscottboggs_gitlab> > you will have problems with math ⏎ ⏎ only bitwise math, at which point the expectation (with pointer offsets) is that you'll be working with unsigned integers. Using a signed integer is the weird way.
<Stephie>
the actual bug is slices not being able to represent more than 4gb of memory, which is a real problem
<FromGitter>
<stronny> @dscottboggs_gitlab I would actually support UInt sizes, I'm just remembering devs' arguments
<FromGitter>
<dscottboggs_gitlab> > it will feel weird to you if you are a C programmer ⏎ ⏎ I write crystal primarily but jump between languages a *lot*, and having signed sizes for slices is super bizarre
<Stephie>
slice size should be UInt64 i think
<Stephie>
or at least greater than 32bit
<FromGitter>
<dscottboggs_gitlab> @stephie it's currently 31 bits...
<Stephie>
yes
<Stephie>
it's a problem
<Stephie>
array size and string size are unlikely to change
<Stephie>
they'll be limited to 2^31 items
<Stephie>
slice size probably should change
<Stephie>
it's unreasonable to allocate an array that big on the heap anyway
<Stephie>
for slices, the situation is different
<FromGitter>
<dscottboggs_gitlab> TBH I don't get why crystal has both Slice and Array. Array methods should be implemented on Slice, why not
<Stephie>
@dscottboggs_gitlab because they're the only safe constructors
<Stephie>
StaticArray exists for the stack
<FromGitter>
<stronny> StaticArray has severe size limitations
<Stephie>
yeah
<Stephie>
keep them small
<FromGitter>
<dscottboggs_gitlab> @stronny only static arrays, dynamic arrays are not supported by the C stdlib in a decent way
<FromGitter>
<stronny> `a[x]` isn't an array though
<FromGitter>
<dscottboggs_gitlab> @stephie yes which is why I was saying that slices are *by default* for heap pointers. Sure you can take a slice of a StaticArray but that's not the *default* usage of a slice
<FromGitter>
<stronny> it's literally just "take a pointer a then offset it by `x*sizeof(typeof(a))`
<FromGitter>
<dscottboggs_gitlab> so is a static array
<FromGitter>
<stronny> it's not!
<FromGitter>
<stronny> it's a bare pointer with offsets
<FromGitter>
<stronny> arrays have sizes at the least
<FromGitter>
<dscottboggs_gitlab> true, there are no bounds checking that way.
<FromGitter>
<dscottboggs_gitlab> I like `#unsafe_at` bettere
<Stephie>
scary
<Stephie>
very scary
<Stephie>
please never put your code on the internet
<FromGitter>
<stronny> harsh!
<FromGitter>
<dscottboggs_gitlab> I meant that I like `#unsafe_at` as an API for accessing without bounds checking rather than that I would use it rather than `.[]` usually
<FromGitter>
<dscottboggs_gitlab> sorry to be unclear
<FromGitter>
<dscottboggs_gitlab> fuck that was a terribly written message
<FromGitter>
<dscottboggs_gitlab> In C, if you write a function that takes a `char[N] x`, where `N` is some sort of defined constant, even if you don't know what `N` is, you can act safely on `x`, just as much as you can on StaticArray, which is what I meant.
<FromGitter>
<dscottboggs_gitlab> so only in that rare case @stronny does C have arrays, I didn't mean to be any more controversial than that.
<FromGitter>
<dscottboggs_gitlab> `Wat.new` sets @w to 0?
<Stephie>
i have no idea how that works @stronny
<FromGitter>
<stronny> that's not an interesting part
<Stephie>
you'll have to look at the assembly
<Stephie>
it's probably luck though
<FromGitter>
<stronny> yes, that's my forst question: why does it comile?
<oprypin>
why not? pointerof is unsafe
<FromGitter>
<dscottboggs_gitlab> ☝️
<FromGitter>
<stronny> just declaring something unsafe isn't a get out of jail card
<Stephie>
why does it *compile*, of course it should compile
<Stephie>
it compiles in C
<Stephie>
pointers are unsafe you can do unsafe things
<FromGitter>
<stronny> some form of escape analysis would be helpful here
<Stephie>
why does it work??
<Stephie>
I ave no clue
<Stephie>
we're not going to put tooling into making unsafe code safer
<Stephie>
rather expanding what is safe
<Stephie>
pointers will always be unsafe in crystal
<Stephie>
and you will always be able to segfault with them
<FromGitter>
<dscottboggs_gitlab> I see what you mean @stronny and have been trying to figure it out for a minute now.... the only thing I can think of is a race condition with `free()`...haha
<FromGitter>
<stronny> well there are different levels of unsafe
<FromGitter>
<stronny> because they aren't malloced
<Stephie>
is how you'd describe it
alexherbo2 has quit [Ping timeout: 258 seconds]
<FromGitter>
<dscottboggs_gitlab> yeah, so like, before that memory gets overwritten, you read from it
<oprypin>
yeah
<FromGitter>
<dscottboggs_gitlab> but you've already released the reference to it, so who knows what it'll be, it's a race condition with anything else that might overwrite it
<oprypin>
i guess the stack frame of the `.value` call overwrites the memory before u get to that value
<oprypin>
you dont need the bump, it's not doing anything noticeable
<FromGitter>
<stronny> Initially I wanted to check the member value, because it worked as expected lol
<FromGitter>
<stronny> unexpectedly worked as expected or something
<hightower2>
Hey oprypin stronny I got a working implementation of that String-like class (well, almost done). I ran some benchmarks just to see whether it even makes sense to develop the idea further:
<FromGitter>
<stronny> @hightower2 which is quite normal given that vanilla String copies the memory
<FromGitter>
<stronny> `23.04ns` idk about that, doesn't dram have typical latency around 90ns?
<FromGitter>
<stronny> maybe you have CPU caches along the way
<hightower2>
stronny hm right that's a good observation. If I run the same test with selecting just 1 char at the same starting offsets, then the custom class is still at the same performance while string[] is faster (cca. 70M vs. 40M/s)
<FromGitter>
<stronny> because you have to flip the bytes, while String doesn't have to
<FromGitter>
<dscottboggs_gitlab> yo @ImAHopelessDev_gitlab what's up
<FromGitter>
<ImAHopelessDev_gitlab> @dscottboggs_gitlab nm, long time no c
<hightower2>
stronny Due to all the complications with it I think I won't use it in the initial implementation, but will rather resort to what oprypin suggested... which was to limit the end with modifying the header, and to modify the start by either specifying start offset or skipping first X chars in regex matches
<FromGitter>
<dscottboggs_gitlab> I've been around, just not as active. Busy Boggs, they call me
<oprypin>
hightower2, hey u can skip the end with regex matches too
<FromGitter>
<watzon> Hey Busy Boggs, how's it going?
<FromGitter>
<dscottboggs_gitlab> hahaha
<FromGitter>
<ImAHopelessDev_gitlab> Busy Boggs™
<FromGitter>
<dscottboggs_gitlab> long week, kinda tired. Gonna play some CS:GO and take a nap today 😛
<FromGitter>
<ImAHopelessDev_gitlab> last time i played cs go, i played the prison roleplaying servers
<FromGitter>
<ImAHopelessDev_gitlab> so fun
<FromGitter>
<stronny> hey I get an idea
<FromGitter>
<stronny> who's gonna redo dwarf fortress in crystal?
<hightower2>
oprypin, got an example?
<FromGitter>
<dscottboggs_gitlab> @ImAHopelessDev_gitlab is the games guy
<oprypin>
hightower2, well i showed you a lookbehind construct at the beginning, now you just add a lookahead at the end
<hightower2>
yes but I don't know where the end is.. I just know how many chars from the beginning I need to stop at.
<FromGitter>
<ImAHopelessDev_gitlab> could do sdl bindings, or crsfml. but iuno just off the top of my head
<FromGitter>
<ImAHopelessDev_gitlab> i aint doing it ,that's for sure ;D
<oprypin>
hightower2, how can you not know where the end is. do you have infinite RAM?
<FromGitter>
<stronny> lookahead takes a constant
<hightower2>
yes I can calculate it from total string size - my stop point. But I assumed this would be slow. Will benchmark. Thanks for the idea
<FromGitter>
<stronny> but he needs an expression like (strlen - start_offset - search_len)
<hightower2>
right
<FromGitter>
<stronny> and you probably can't compile this regex
<oprypin>
yea
<FromGitter>
<stronny> and compiling it each time will be costly
<hightower2>
that's true
<hightower2>
yeah, right, for that same reason neither look-behind nor look-ahead would be desirable in the regex
<hightower2>
good point
<FromGitter>
<stronny> what would be cool is AOT regex compilation in crystal heh
<FromGitter>
<stronny> like if you have a constant value it gets replaced by the matching code
<FromGitter>
<dscottboggs_gitlab> no reason we couldn't do that, but i can't imagine that would be a pre-1.0 priority
<renich>
I know it completely sucks, but I managed to migrate ~300 articles from jekyll to pelican (which supports rst natively).
<renich>
I am, though, interested in improvements. I will take a look at the frontmatter.cr file straight-shoota sent me. Any other suggestions are welcome.
<FromGitter>
<Blacksmoke16> `#gets` has a `chomp` option which would remove trailing \n
<oprypin>
watzon, egh i didnt end up looking at it
<oprypin>
lodenos, at the end of the fiber's execution do `channel.send`, and the waiter needs to do `channel.receive`. syncing is done through channels only
<oprypin>
which is a separate object to the fiber
<FromGitter>
<lodenos> yes but with channel I have a probleme
<FromGitter>
<j8r> you can also have a counter incremented before each spawn
<jhass>
Fiber.yield is nothing you should do unless you know exactly why it would fix your issue. It certainly has nothing to do with waiting for a fiber
<jhass>
select is for when you want to wait for one of multiple channels or with a timeout
<jhass>
so yeah, try to show us a minimal example of what you're trying and then we might be able to point out why it doesn't work :)
<oprypin>
Blacksmoke16, why did u recommend yield :s
<FromGitter>
<Blacksmoke16> that was my understanding...
<jhass>
it assumes so much
<jhass>
it assumes the main fiber does not die, never gets blocked and MT is off
<jhass>
then you may need this currently. Often blocking the main fiber on some synchronization channel or just putting it to sleep forever seems the more reasonable chocie though
<FromGitter>
<Blacksmoke16> for sure, depends on what his end goal is
<jhass>
Fiber.yield is an advanced tool not to be thrown to people still figuring things out, IMO :)
<jhass>
it's something we hopefully can make private to stdlib at some point
<FromGitter>
<Blacksmoke16> gotcha
<FromGitter>
<stronny> so I've done that by patching sheduler making it check for fiber.dead? on reschedule and running hooks basically
<FromGitter>
<stronny> channels suck big time
postmodern has joined #crystal-lang
<FromGitter>
<straight-shoota> jhass, maybe we should rename the method to `Fiber.unsafe_yield`. Or make it nodoc.
<jhass>
mmh
<FromGitter>
<straight-shoota> (it's not really unsafe, but it would alert people to not use it unless they understand what it does)
<hightower2>
Hey can someone remind me how does a regex refer to a previous match... Like, if I allow the opening quote to be (["']), how to match the same one as closing quote? Is it /(["'])...(\1)/ or something else?
<FromGitter>
<straight-shoota> Also, every usage of `Fiber.yield` can just be replaced by `sleep 0.seconds`. Maybe that's not as nice as an API, but it is more explicit about what it does
<FromGitter>
<tenebrousedge> hightower, should be
<jhass>
lodenos: prepend channel = Channel(Nil).new(data.size), do channel.send nil at the end of each spawn, replace ? with data.size.times { channel.receive }
<hightower2>
tenebrousedge great gonna try, thanks
<jhass>
maybe pick a better name than channel, stop signal or so
<FromGitter>
<lodenos> Srry the indent it's a bit broken
<FromGitter>
<lodenos> @ jhass
<jhass>
postmodern: note that's O(n), so if you do it a lot an invert might still be worth it
<FromGitter>
<lodenos> the puts "test" start in first but I try/want wait when all fiber has finised the works
<FromGitter>
<tenebrousedge> jhass isn't inverting it also O(n)?
<postmodern>
jhass, good point
<jhass>
yes but only paid once (+ allocation overhead)
<jhass>
so if you have many lookups it might be worth
<FromGitter>
<tenebrousedge> fair
<jhass>
lodenos: yes that pattern doesn't work. if you look on Channel#receive? you have to actually close it on the other end once done. Of course that only works if you share to only one other fiber. Otherwise you need to keep track of how many fibers to wait for you spawned and receive that many times
<jhass>
so yeah, looping on receive? only makes sense if you send actual data back from one single other fiber
<jhass>
which then can close the channel once its done
<jhass>
I guess you could keep an array of channels, one per fiber and loop over that array and .receive? once on them, but I see no benefit
<jhass>
also not sure whether that's just the borked paste, the end of the .each loop is missing, but the wait routine should be outside the loop of course
<FromGitter>
<lodenos> Thx @jhass I see, I have a logic multi-thread like in C/C++, I would like use the power of Fiber for continue work when a request waiting for receiving...
<jhass>
that'll do it :)
<FromGitter>
<lodenos> Yes but I search another kind of style of writing more elegant
<FromGitter>
<lodenos> like fuild, but actually not really, a bit shit, not really elegsnt I found
<jhass>
structred concurrency would do this nicely, but for now that's the best we have :)
<FromGitter>
<randiaz95> Hi guys! What do you guys recommend as the best linear algebra library in terms of ease of api syntax?
_ht has quit [Quit: _ht]
<hightower2>
Hey I have a LibC function that takes LibC::Char** argument. How can I produce that? Is that Pointer(String).new ?
<hightower2>
actually, get an error on Pointer().new... maybe 'reference'
<FromGitter>
<randiaz95> I would try using single quote
<FromGitter>
<randiaz95> not String but a char
<FromGitter>
<randiaz95> Pointer('x').new
<hightower2>
Well it requires a class, not instance
<FromGitter>
<randiaz95> Did you try the Char class?
<FromGitter>
<randiaz95> Perfect I am really learning now lol
<FromGitter>
<Blacksmoke16> 💭
<FromGitter>
<Blacksmoke16> 👍
<FromGitter>
<randiaz95> 58 hour traininng LMAOO
<FromGitter>
<randiaz95> The first time I ran it i forgot to force garbage collect the previous feature engineering columns and I had 100 random columns
<FromGitter>
<randiaz95> I might rewrite everything in Crystal and pray for speed benefits in the feature engineering step
<FromGitter>
<tenebrousedge> Google Foobar Challenge: Completed!! ⏎ Python: Learned
<FromGitter>
<randiaz95> took me forever to write concise python like 1.5 years rocking pandas/sqlalchemy/listcomps/dictcomps
<FromGitter>
<randiaz95> But even then, it takes time lol
<FromGitter>
<tenebrousedge> for this I didn't get pandas or numpy or sqlalchemy
<FromGitter>
<randiaz95> Holy guac.
<FromGitter>
<galvertez> um. does `Time.now` not work in carc.in?
<FromGitter>
<randiaz95> it would've taken months to train this gradient boosting algo if I didn't have numpy
<FromGitter>
<dscottboggs_gitlab> Time.now doesn't work anymore
<FromGitter>
<galvertez> rip
<FromGitter>
<tenebrousedge> but I have a bad habit of writing the most concise code that I can <_<
<FromGitter>
<dscottboggs_gitlab> `Time.local` or `Time.utc`
<FromGitter>
<galvertez> what do we use instead?
<FromGitter>
<galvertez> aha. you know what i think i remember seeing a thread about that a while ago
<FromGitter>
<galvertez> thank you sir
<FromGitter>
<dscottboggs_gitlab> np
<FromGitter>
<galvertez> i haven't been writing crystal much lately :(
<FromGitter>
<randiaz95> How dare you
<FromGitter>
<randiaz95> Go webscrape something NOW
<FromGitter>
<randiaz95> lol
<oprypin>
did i really just spend like 2 hours debugging stuff just because i didnt write `extern "C"`
<FromGitter>
<dscottboggs_gitlab> :(
<FromGitter>
<randiaz95> bruh; why you using c and crystal at the same time?
<FromGitter>
<randiaz95> They are like chocolate and spaghetti. ⏎ ⏎ Both good, not good together.
<FromGitter>
<dscottboggs_gitlab> wrapping C's unsafe nature in crystal's type safety is one of the best things about crystal to me
<FromGitter>
<randiaz95> Yep I was wrong lol I just thought I could just use crystal for web/mobile servers and not use it for client side.
<FromGitter>
<dscottboggs_gitlab> well, aside from how nice crystal is 😀
<FromGitter>
<randiaz95> but yes. If you can ship crystal games I am sure it would perform better than java but with MUCH Better syntax.
<FromGitter>
<dscottboggs_gitlab> yeah, unfortunately SFML is super verbose, to make any decent games you'd need a decent native high-level library overtop of that
<FromGitter>
<randiaz95> Wouldn't you make that in Crystal though?
<FromGitter>
<randiaz95> Thats wut the crsfml is?
<oprypin>
dscottboggs_gitlab, srsly
<oprypin>
:D
<FromGitter>
<dscottboggs_gitlab> > Wouldn't you make that in Crystal though? ⏎ yes ⏎ > Thats wut the crsfml is? ⏎ I'm just going by what I vaguely recall someone else telling me like a year ago so I could be wrong or out of date but I meant something overtop of CRSFML [https://gitter.im/crystal-lang/crystal?at=5e9b908a74bfed5a1b493139]
<FromGitter>
<randiaz95> Well graphics is not my expertise; so I wouldn't know :/
<FromGitter>
<randiaz95> I'm focusing more on NLP
<FromGitter>
<dscottboggs_gitlab> me either, not really too into making games either
<FromGitter>
<randiaz95> Text data is so complicated you need a fast language
<FromGitter>
<dscottboggs_gitlab> Have you looked at D?
<FromGitter>
<randiaz95> Yeah; didn't love the syntax much when I did.
<FromGitter>
<randiaz95> I like Crystal cause I like ruby syntax.( Very novel syntax for me and has functional methods I love )
<FromGitter>
<dscottboggs_gitlab> D's `std::array` has overloads for mathematical operators that use simd instructions when possible
<FromGitter>
<randiaz95> Really?
<FromGitter>
<dscottboggs_gitlab> yes
<FromGitter>
<dscottboggs_gitlab> instant win for NLP
<FromGitter>
<randiaz95> not necesarily; int[char[2]] aa; explicitly. saying data types decreases all types of productivity lol
<FromGitter>
<randiaz95> all I need is float and string
<FromGitter>
<dscottboggs_gitlab> it has `auto`, or am I misunderstanding?
<FromGitter>
<randiaz95> ah..
<FromGitter>
<randiaz95> Interesting; it seems a little difficult to do tensor algebra without functional methods; does it have?
<FromGitter>
<dscottboggs_gitlab> fat arrow syntax for lambdas
<FromGitter>
<randiaz95> D is just like another basic statically typed language
<FromGitter>
<randiaz95> Omit the auto and I will consider lol
<FromGitter>
<randiaz95> I mean the difference between crystal and D probably is marginal versus translating python to crystal which is tremendous.
<FromGitter>
<dscottboggs_gitlab> yes, I just think there are a lot of benefits to D specifically for performance-critical and NLP applicatiosns
<FromGitter>
<dscottboggs_gitlab> you can drop the `auto` for `const` and `immutable` variables 😀
<FromGitter>
<randiaz95> haha, I wonder what simd really means under the hood
<FromGitter>
<randiaz95> I understand it increases performance.
<FromGitter>
<watzon> Surprisingly Python to Crystal isn't a massive leap
<FromGitter>
<dscottboggs_gitlab> it can be
<FromGitter>
<watzon> Depends on how dynamic you get with it I guess
<FromGitter>
<randiaz95> It has all the NLP shards to build on it.
<FromGitter>
<watzon> Same with JS
<FromGitter>
<watzon> JS is much more difficult to port in my experience
<FromGitter>
<randiaz95> Thing is I am already investing in learning Dart + Crystal
<FromGitter>
<dscottboggs_gitlab> yeah it's dynamic-ness is a lot more front and center
<FromGitter>
<randiaz95> because dart compiles to everything
<FromGitter>
<randiaz95> In theory you can write your server + web app + ios + android in Dart
<FromGitter>
<randiaz95> and comes with Great component libraries for UI
<FromGitter>
<dscottboggs_gitlab> @watzon in theory you could just create a dynamic language on top of crystal. optional static typing, if you will
<FromGitter>
<randiaz95> a new python/ruby
<FromGitter>
<dscottboggs_gitlab> I've thought of doing it but I hesitate because it seems like a bad idea
<FromGitter>
<randiaz95> The problem is C syntax
<FromGitter>
<randiaz95> It does not allow for huge productivity gains
<FromGitter>
<randiaz95> If you think in terms of functions instead of algorithms inside of the functions its much more productive.
<FromGitter>
<randiaz95> Who cares about for(i=0? i don't care about the index, I care about the element.
<FromGitter>
<dscottboggs_gitlab> not sure what you mean @randiaz95
<FromGitter>
<dscottboggs_gitlab> oh you just don't like for loops? me either lol
<FromGitter>
<watzon> @dscottboggs_gitlab actually thought about that. It would be really useful for configuration files, scripting inside of programs, etc
<FromGitter>
<watzon> Basically just a very lightly modified Ruby dialect