Programming thread

  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
>write main.lua
>save main.lua
>lua main.lua

somehow this is slower than clunkily writing a program line by line and having no way to save it or output to a file. (i hate repls)

it might help if you wrote correct lua into the repl as well. you know you can keep lexical scoping by typing do at the start of the session?
 
i hate repls
I Love REPLs. It's more about exploring and that immediate response. You also probably should have file ready so if you like some snippets you just paste it into it, and then you can do reload of file you are working on.

Though probably the best dev experience I had was with common lisp and nvlime. Being able to just send snippets under your cursor or change them on the go, even when application was in middle of loop (like in a game), was amazing.
 
If you're riffing on Scheme, I'm reporting you to Stalin: https://github.com/barak/stalin
i would also like to mention scsh as a shell
there are other compilers (these are just some more notable ones): gambit scheme, chez scheme, chicken scheme, gnu guile (to an extent), and the aforementioned stalin
it might help if you wrote correct lua into the repl as well. you know you can keep lexical scoping by typing do at the start of the session?
wtf that's fucking magic didn't know that
of course a decent repl treats lines of input as if they were in a single lexical environment already

edit: typing "do" will put the repl into extended input mode which makes it not so good
somehow this is slower than clunkily writing a program line by line and having no way to save it or output to a file. (i hate repls)
a good text editor lets you write some code in an editor then fuck around with it in the repl and then change it a bit and then send it back into the repl to be fucked with again and then you define some other function in the repl and fuck around with it before sending it to the editor
I Love REPLs. It's more about exploring and that immediate response. You also probably should have file ready so if you like some snippets you just paste it into it, and then you can do reload of file you are working on.

Though probably the best dev experience I had was with common lisp and nvlime. Being able to just send snippets under your cursor or change them on the go, even when application was in middle of loop (like in a game), was amazing.
yes repls are amazing especially for playing around with pure functions
 
Being able to just send snippets under your cursor or change them on the go, even when application was in middle of loop (like in a game), was amazing.
Live coding is pretty sweet.
a good text editor lets you write some code in an editor then fuck around with it in the repl and then change it a bit and then send it back into the repl to be fucked with again and then you define some other function in the repl and fuck around with it before sending it to the editor
You and I both know the only text editors that do this are Lisp editors and you and I both know why
 
>write main.lua
>save main.lua
>lua main.lua

somehow this is slower than clunkily writing a program line by line and having no way to save it or output to a file. (i hate repls)

it might help if you wrote correct lua into the repl as well. you know you can keep lexical scoping by typing do at the start of the session?
That's why you write the script in a file and have a hotkey to send the selected instructions to the repl. At least that's how I work with F# interactive. VERY fast iteration speed. And easily allows me to interactively explore objects as they are, so I can easily drill down to the data I want.
Live coding is pretty sweet.

You and I both know the only text editors that do this are Lisp editors and you and I both know why
Rider supports it natively with f#, and even c#.

Also, a repl is definitely better for languages that treat everything as an expression, than languages that are mostly statements.
i'm glad we agree that lisp is the best language ever made and that emacs uber alles :)
ML derivatives are criminally underrated though.

Algol derivatives, in terms of syntax, has got to be the worst kind, and somehow is the most popular.
 
ML derivatives are criminally underrated though.
idk that syntax doesn't really vibe with me
there's something really special about s-expressions, how extremely fucking simple it is... yet it can do anything algol syntax can and even more
ml-style syntax is just kind of ok

anyway if i ever want to try ml i would probably check out mlton or maybe ocaml because i'm not fucking touching the clr (cancerous language runtime)
 
You and I both know the only text editors that do this are Lisp editors and you and I both know why
Depending on the Scheme implementation, many of them are perfectly capable of doing this while using vim as an editor. I know because I've been doing this exactly for most of this week. (Note: Some make this VERY HARD to do; I am not sure that there is a less consistent group of software than "Scheme language" software, whether interpreted or compiled. Scheme guys are working on this and R7RS is quite nice.)

there's something really special about s-expressions, how extremely fucking simple it is
Yes. S-expressions are the cure for all the weird custom syntaxes from other languages, especially the ultra-weird outliers like C-style preprocessor+etc. bazillion-step build process.
 
Depending on the Scheme implementation, many of them are perfectly capable of doing this while using vim as an editor. I know because I've been doing this exactly for most of this week. (Note: Some make this VERY HARD to do; I am not sure that there is a less consistent group of software than "Scheme language" software, whether interpreted or compiled. Scheme guys are working on this and R7RS is quite nice.)
I'm glad I know both Vim / Neovim and Emacs. Attempting to set up Emacs for Java was painful and I gave up. Neovim + LazyVim supports it with no effort. But if you want to run any kind of Lisp REPL in either, Emacs is your best bet.
anyway if i ever want to try ml i would probably check out mlton or maybe ocaml because i'm not fucking touching the clr (cancerous language runtime)
I used to use OCaml pretty heavily some years ago and the summit of my achievement was writing insanely janky but performant fractal code when I was medicated but still psychotic. I really want to get back into it. Back then Real World OCaml was only in its first edition. Now it's online. There are a number of other books you can find on OCaml that are on Amazon (and consequently on shadow libraries) that are older but the language standard itself has been pretty stable for a long time and these resources are still largely relevant, as I understand it. You just want to make sure to be aware of what are now considered best / modern practices in OCaml and its ecosystem. Back then I was using Batteries but it seems Base and Core are now the preeminent OCaml third-party standard library. It seems a huge amount of all this third-party work (including Base and Core) is done by the New York City finance firm Jane Street and then released to the public as open source software. I don't know how seriously you take the language benchmarks game but OCaml is constantly among the strongest GC'd performers, comparable to SBCL or even Julia. Compiles right to a binary. Of course there is an "awesome" README for OCaml with a huge litany of the aforementioned and other resources.
 
idk that syntax doesn't really vibe with me
there's something really special about s-expressions, how extremely fucking simple it is... yet it can do anything algol syntax can and even more
ml-style syntax is just kind of ok

anyway if i ever want to try ml i would probably check out mlton or maybe ocaml because i'm not fucking touching the clr (cancerous language runtime)
ml (and other functional languages too) always make me ask "but why?" and i can never come up with a good answer except "using it makes me feel smart"
like, it's not performant, it's not easy to write or read, the only upside seems to be that it makes me feel like a goddamn genius when i come up with super concise and elegant solutions
 
ml (and other functional languages too) always make me ask "but why?" and i can never come up with a good answer except "using it makes me feel smart"
like, it's not performant, it's not easy to write or read, the only upside seems to be that it makes me feel like a goddamn genius when i come up with super concise and elegant solutions
my guess is that it makes it easier to express the painful shit, its static typing makes your programs faster and more correct, and you don't have to care about object lifetimes or deallocating memory either
these factors combine to make it possible to somewhat quickly write a decent program that runs fast while not looking like shit, without requiring you to rewrite stuff in c quite as often as <shitty interpreted metaclass late-binding-everywhere niggerlanguage you hate here>
also functional languages can be fast as fuck. sometimes you see ml programs running at c speed if the ml program is written in a certain way and the c programmer is slightly too drunk for gcc to know what the fuck he means
 
like, it's not performant, it's not easy to write or read, the only upside seems to be that it makes me feel like a goddamn genius when i come up with super concise and elegant solutions
As mentioned it can definitely be performant. It will not be as performant as well-written C/C++/assembly but that's a tradeoff often worth making. OCaml and Jane Street were mentioned earlier. High-tech financial firms often require code that runs very fast. I don't work for Jane Street and don't know how often they drop down to C for example, or even make use of ASICs, as I've heard of before in these settings, but I assume that OCaml is sufficient for many of their needs.

I know this is a <shitty interpreted metaclass late-binding-everywhere niggerlanguage you hate here>, but matz (creator of Ruby) may have some words that speak to how you feel about writing FP languages. (Ruby, FWIW, does have some FP features.)
 
ml (and other functional languages too) always make me ask "but why?" and i can never come up with a good answer except "using it makes me feel smart"
like, it's not performant, it's not easy to write or read, the only upside seems to be that it makes me feel like a goddamn genius when i come up with super concise and elegant solutions
Writing in functional languages is like 20% of the effort and 70% of the performance in a lot of cases, compared to C. Along with that, they usually come with a much more expressive type system that can help you reduce certain classes of errors to almost never occur. (like accidentally misusing an error code as a status one). If the types don't match up, you are more likely than not doing something wrong so the compiler tells you instead of you having to find out yourself. And much lower reliance on public mutable state reduces another kind of error, namely accidentally mutating state you shouldn't be mutating.

I am absolutely braindead, which is why I prefer functional programming languages.
 
Writing in functional languages is like 20% of the effort and 70% of the performance in a lot of cases, compared to C. Along with that, they usually come with a much more expressive type system that can help you reduce certain classes of errors to almost never occur. (like accidentally misusing an error code as a status one). If the types don't match up, you are more likely than not doing something wrong so the compiler tells you instead of you having to find out yourself.
I don't know how much I individually have benefited from static typing but since type inference exists it's not a huge drag
And much lower reliance on public mutable state reduces another kind of error, namely accidentally mutating state you shouldn't be mutating.
That's Erlang and Elixir's entire concurrency model right there. Since Ruby was just mentioned I believe Elixir is intended to be like Ruby but much more FP and fundamentally concurrent.
 
know this is a <shitty interpreted metaclass late-binding-everywhere niggerlanguage you hate here>, but matz (creator of Ruby) may have some words that speak to how you feel about writing FP languages. (Ruby, FWIW, does have some FP features.)

matz said:
Instead of emphasizing the what, I want to emphasize the how part: how we feel while programming. That's Ruby's main difference from other language designs. I emphasize the feeling, in particular, how I feel using Ruby. I didn't work hard to make Ruby perfect for everyone, because you feel differently from me. No language can be perfect for everyone. I tried to make Ruby perfect for me, but maybe it's not perfect for you. The perfect language for Guido van Rossum is probably Python.

This is the secret that's made Ruby continue to be one of the best-in-class implementations of what it is. Ruby's metaprogramming has gotten really good, for example. Matz is one of the most underrated leading voices in tech. And, IMO, he accomplished his goal. Ruby is so comfy to code in that I don't realize my bad design choices until way too late.
 
ml (and other functional languages too) always make me ask "but why?" and i can never come up with a good answer except "using it makes me feel smart"
like, it's not performant
MLs have a perpetually-replenishing stock of autistic FP-nerd grad students who can squeeze a term project out of writing new optimizations for their favorite ML. They'll always be pretty fast as long as that continues to be the case.
 
This is the secret that's made Ruby continue to be one of the best-in-class implementations of what it is. Ruby's metaprogramming has gotten really good, for example. Matz is one of the most underrated leading voices in tech. And, IMO, he accomplished his goal. Ruby is so comfy to code in that I don't realize my bad design choices until way too late.
He mentioned Larry Wall is his hero. Wall is a pretty cool guy and I remember being really into Perl 5 in late 2000s, though it hasn't aged well. I think Ruby is a better Perl than Perl 5. I'm also peripherally interested in Raku (formerly Perl 6). Its expressive power and relative obscurity certainly does seem to be a nice safeguard against getting replaced by pajeets.
 
Back
Top Bottom