[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1673773507497.png (55 KB, 767x498)
55 KB
55 KB PNG
>CL
extremely clunky language with funcall and shitty DSLs everywhere. At least quicklisp fixes some of this
>Scheme
lmao
>Racket
has a lot of "batteries" and nice features but the interface is very inconsistent
>Clojure
Almost gets it right. I say "almost" because most of the "polymorphic" functions (e.g. filter, map, into) for working with data structures (vectors, maps, etc. ) behave differently depending on the type of structure they're used with. Clojure's anonymous function shorthand #(... % ...) is fucking retarded btw. Oh, and it runs on the JVM which is kind of nice but also not really
>>
>>91102934
Write your own. Congrats, you made another DSL.
>>
because all of the attention goes into some pubehead's immutability fetish so nobody builds anything serious in the other dialects anymore
>>
>>91102966
immutability is good though
the last thing you want to do is fix the subtle bugs caused by some fuckhead mutating something deep in a complex data structure
>>
>>91102934
>butterflyjak
I like it
>>
File: Primary--1533512212--img.png (166 KB, 2000x1462)
166 KB
166 KB PNG
>>91102934
Is this supposed to be a parody of this tranny logo?
>>
Scheme is The Right Thing. What's needed is a better standard library and infrastructure, and a half-decent implementation, even if we have to sacrifice call/cc.
>>
>>91102934
go back to your qafe circlejerk website you useless fucking wojackspamming faggot
>>
>>91102934
>Clojure's anonymous function shorthand #(... % ...) is fucking retarded
how would you improve it?
>>
>>91103489
don't need to be a chef to see that the soup sucks.
The three commandments of #() are:
1. you WILL NOT nest #()
2. you WILL NOT supply more arguments than are explicitly mentioned. You WILL use every argument explicitly. You WILL NOT write const
3. you WILL NOT mix it with data structure shorthand. You WILL write #(vector %2 %1) instead of #([%2 %1]) or #[%2 %1]
How to fix them:
1. figure out some rule for nesting them. maybe add an option to change the 'anonymous` var from `%` to something else, or some rule for changing it as you nest, e.g. from % to %% to %%% and so forth.
2. be more liberal about the argument count. If extra args are supplied, just ignore them
3. make the shorthand work for forms like #[%2 %1]. Change the hash-set shorthand to accommodate this change.
There could be issues with these changes. Then again, I'm not the chef
>>
the only lisp with a userbase greater than 8 users is emacs lisp
>>
>>91103357
too soulful for trannies
>>
>>91103811
yeah I think so too
>>
>>91103785
yeah but dynamic scope is just insanity.
>>
>>91103258
If you work with retards there is no language that can save you
>>
>>91104239
This is what you look like. You are the silly fish.
>>
>>91103776
>3. you WILL NOT mix it with data structure shorthand. You WILL write #(vector %2 %1) instead of #([%2 %1]) or #[%2 %1]
bind the the identity function to id, then you could just do #(id [%2 %1]) which isn't too bad

I also rename unsigned-bit-shift-right to lsr, bit-shift-left to lsl and so on
>>
>>91104204
yeah, makes a functional programming style pretty much impossible
>>
>>91104204
why did they used it in the first place?
this completely break the substitution model, I have no idea of a single use case for it, I don't know how they could programmed with this
>>
LFE is the answer
>>
>>91103776
>2. be more liberal about the argument count. If extra args are supplied, just ignore them
terrible idea, especially seeing how it already does provide variable arity via %&

What I would like is if you could pass a map as the argument to it and then use the values as %keyword, like this
(filter #(< %weight 75) girls)
>>
>>91103776
>2. be more liberal about the argument count. If extra args are supplied, just ignore them
Done.
sub add {
my ($a, $b) = @_;
$a + $b;
}
print add(1, 2, 3);
>>
>>91104705
obviously "girls" here would contain entries like {:fname "Linda" :lname "Shittingham" :height 166 :weight 53 :iq 105} and so on

>>91104729
I don't think you understand what we're even discussing here
>>
>>91104784
>I don't think you understand what we're even discussing here
are you being a nigger on purpose?
>If extra args are supplied
check
>just ignore them
check
>>
>>91103429
>sacrifice call/cc
Is this actually necessary for performance?
I feel like you could implement a really inefficient call/cc without impacting the speed of anything else, then just tell people to avoid it.
Unless all you're suggesting is the avoidance, in which case yeah, you really can't justify using call/cc in most instances.
It's basically the goto of co-routines.

>Scheme is The Right Thing.
Honestly, Guile is already most of the way there.
I feel like if you did some cleaning up and beefed out the prelude you'd basically have an ideal lisp.
That said I think, in practice, lisp languages should support gradual typing much more than they do for both performance and correctness.
CL gets the closest in this regard; it fuses static and dynamic types almost perfectly but the type system is still very basic and a bit janky. (Let alone the fact that it doesn't do anything half the time because the spec doesn't require you to check types.)
>>
>>91103489
(λ [a b] (- b a))

I'll take my prise in cash.
>>
>>91104904
ser, we're talking about Clojure's short-hand notation meant for anonymous one-liners that you pass to higher-order functions. You posted three lines of code that look more unwieldy than even Clojure's long-form notation. And even in short-form, what you posted can already be done via let:
#(let [[a b] %&] (* a b))
Which could be used like this without throwing an error:
(#(let [[a b] %&] (* a b)) 3 5 7)
;=> 15

but it's pointless because if you're gonna do argument destructuring like that you might as well use the long-form notation, which is more readable and more flexible.
>>
>>91105730
here's your let
$ perl -le 'print do { ($a, $b) = (3, 5, 7); $a * $b }'
15
>>
File: lisp_shield.png (191 KB, 400x400)
191 KB
191 KB PNG
>>91102934
CL is the best lisp
>>
>>91106650
$ bb '(let [[a b f c] [3 5 / 7 9]] (f c a b))'
7/15

again, not relevant to what we were actually talking about
>>
>>91106878
you were talking about lambdas, I get it, hence my first example.
it's not a lamba, it's a function, but changing it into a lambda just requires to remove the function identifier
>>
>>91102934
Implementing a lisp is trivial. If you don't like any of the popular ones, just make your own that works exactly how you want.
>>
>>91104705
what if the map has keys that aren't keywords?
>>91104729
you'd use (defn ...) for that. the point of #() is making anonymous functions to supply to HOFs where you may ignore one or more args
>>91107054
sure but then there's basically nothing implemented for it
>>
>>91102934
leave it to an idiot to talk about shit he has no clue about
>>91104204
that hasn't been the case since emacs 24 you goddamn buffoon
>>91104373
because lisp originally only had what you call 'dynamic scope' which really is indefinite scope and dynamic extent. it's more flexible than lexical scoping, which was added later
the reason why emacs lisp is like this is because it's been designed by rms, who is a big lisp purist and an oldschool guy, and probably also due to technical constraints due to computers being less powerful when emacs was being made.
also see
https://www.gnu.org/software/emacs/emacs-paper.html#SEC18
>>
File: asdf.png (9 KB, 320x449)
9 KB
9 KB PNG
>>>91102934 (OP)
>leave it to an idiot to talk about shit he has no clue about
>>>91104204
>that hasn't been the case since emacs 24 you goddamn buffoon
>>>91104373
>because lisp originally only had what you call 'dynamic scope' which really is indefinite scope and dynamic extent. it's more flexible than lexical scoping, which was added later
>the reason why emacs lisp is like this is because it's been designed by rms, who is a big lisp purist and an oldschool guy, and probably also due to technical constraints due to computers being less powerful when emacs was being made.
>also see
>https://www.gnu.org/software/emacs/emacs-paper.html#SEC18
>>
>>91104375
>lisp flavored erlang
god tier based
>>
>>91104375
what's so good about erlang?
>>
>>91104375
tsuki pls
>>
use symta (lol)
>>
>>91108270
>because lisp originally only had what you call 'dynamic scope' which really is indefinite scope and dynamic extent. it's more flexible than lexical scoping, which was added later
Bingo thanks anon, I will test what you can and can not do in common lisp and perl to see how expressive/limiting it is knowing this.
>you'd use (defn ...) for that. the point of #() is making anonymous functions to supply to HOFs where you may ignore one or more args
I get it
$ perl -E 'sub apply { my $f=shift; $f->(@_) } $add = sub { my ($a, $b)=@_; $a + $b }; say apply($add, 10..20)'
21
>>
>>91112005
>>91108240



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.