|
MrMoo posted:Yup, with Google fonts you can just use their hosting and everything is hidden behind code they provide. sure if you want to make it easier for goog to spy on your users
|
# ? Jun 12, 2022 22:05 |
|
|
# ? Apr 28, 2024 04:06 |
|
Carthag Tuek posted:sure if you want to make it easier for goog to spy on your users in 2022 you are already completely pwned by faang and there's no turning back
|
# ? Jun 12, 2022 23:42 |
|
lambda just means anonymous function (function with no name), it’s inline in code instead of defined as part of your class or in the global namespace it’s confusing for lots of reasons, also because of aws serverless functions being called lambda too
|
# ? Jun 13, 2022 00:06 |
|
Gentle Autist posted:lambda just means anonymous function (function with no name), it’s inline in code instead of defined as part of your class or in the global namespace they're named after the anonymous functions though so if lambda functions were called something else, the serverless functions owuld likely also be named that too
|
# ? Jun 13, 2022 00:12 |
|
some typesetter didnt wanna do separate x hat dealios and now echi gets to be confused all the time
|
# ? Jun 13, 2022 00:17 |
|
not that I wasn’t before
|
# ? Jun 13, 2022 01:17 |
|
just think, we could have been living in a world with hat functions and aws hat services
|
# ? Jun 13, 2022 01:30 |
|
fedora functions
|
# ? Jun 13, 2022 01:35 |
|
Amazon Top Hat brought to you by Jeff Bezos
|
# ? Jun 13, 2022 01:41 |
|
lambda calculus is actually amazingly cool and if you care about cs theory at all you should try learning it. and it's not very hard to learn, because you can think of it as a simple programming language with only three language features: variables, function definitions, and function applications (aka calls). that's it. nobody would actually program in this language, but it serves as a theoretical foundation, because it turns out those three features are all you need for expressive power equivalent to a turing machine. you can come up with formal definitions of everything else you'd normally have (numbers and arithmetic, pairs, lists, etc) in terms of the lambda calculus, look up church encoding. and then you have other formal systems that are ultimately extensions of the lambda calculus and are actually used in modern research papers, so it's good to know if you ever want to read those. but even if not it's neat stuff.
|
# ? Jun 13, 2022 02:06 |
|
the term "lambda" being used for anonymous function (or even by extension to a function in general, as in aws) is the bs cs top 50 nerd's absolute favorite kind of term: gatekeeping jargon whose use is unimpeachable due to association with core theory and the legendary church-turing of yore
|
# ? Jun 13, 2022 02:11 |
|
DELETE CASCADE posted:the term "lambda" being used for anonymous function (or even by extension to a function in general, as in aws) is the bs cs top 50 nerd's absolute favorite kind of term: gatekeeping jargon whose use is unimpeachable due to association with core theory and the legendary church-turing of yore actually my insufferable trait is throwing the term cyclomatic complexity around because the whitespace from the nesting bothers me
|
# ? Jun 13, 2022 02:14 |
|
oh well excuse everyone for not learning your stack's special snowflake terminology for everything, as if it was invented there
|
# ? Jun 13, 2022 02:32 |
|
akadajet posted:fedora functions M'lambda
|
# ? Jun 13, 2022 03:00 |
|
also the name "anonymous function" is a bit weird, like why does it matter so much that the function doesn't have a name? the reason is because this is novel to C programmers. in ansi C a function is a special kind of thing, and the only way you can create one is by defining it by name at the top level of a source file. unlike a first-class value such as an int, you can't pass a function to another function, nor can you return a function as a result. in C you can pass/return pointers to functions, because in C you can get a pointer to anything, but these "function pointers" are technically a special kind of pointer that can't even be cast to void*. any function pointer variable you manage to obtain will ultimately refer to a function that was defined by name at the top level of a source file ok well, who the gently caress cares, right? a lot of examples you'll see in articles are like, hey i'm gonna pass this anonymous incrementer function to another function, so i write List.map (lambda x -> x + 1) lst and it increments every value of lst, magic! but i could have defined the lambda instead as incr, then passed a pointer to incr, how is this any better than C? the key is really in the italicized part above. what if, inside the definition of a function, i could create another (anonymous) function, and then return that new function as a result to be used outside my containing function's lexical scope, which is now ending because we are returning? and keep in mind, this new function can refer in its own definition to values that were available in the containing function's scope. it turns out that you can build truly massive edifices upon this house of cards but we are still in C brain, so how does this poo poo work? when my containing (outer) function returns, its stack frame goes away, and with it the values in memory that the inner function may have referred to. what's the inner function supposed to do, magically malloc() copies of those variables on the heap for itself to remember them? then who's responsible for calling free() on them? this concept of a first-class (passable, returnable) function that remembers the values of free variables at the time it was defined is called a closure. the manual memory management style of C essentially precludes closures, and conversely most languages that support closures will have some variety of automatic garbage collection oh wait this post was supposed to have a point. so after all, what's important about the anonymous function concept specifically? well if you are defining your inner function/closure inside an outer function, to be returned to a caller of the outer function, then i suppose you could give the inner function a name, but that name would disappear along with the scope of the outer function just like any other variable, so nobody else could ever use the name. basically, the presence of anonymous functions suggests that a closure-based style of programming is supported, because they're natural with it but useless without it DELETE CASCADE fucked around with this message at 06:18 on Jun 13, 2022 |
# ? Jun 13, 2022 05:12 |
|
A function that takes one function and returns another function is generally called a decorator
|
# ? Jun 13, 2022 05:27 |
|
Presto posted:M'lambda
|
# ? Jun 13, 2022 05:29 |
|
yeah decorators are a great example and they even have a special python syntax for them. then again python closures are busted rear end bullshit because of late binding but that's a topic for anothuhhhhhhhhhhhhhhhhhh
|
# ? Jun 13, 2022 05:35 |
|
Gazpacho posted:oh well excuse everyone for not learning your stack's special snowflake terminology for everything they used "isomorphic"? must be nodejs they used "delightful"? must be ruby they used "kill me"? C
|
# ? Jun 13, 2022 06:14 |
|
I've been through the lambda on a func with no name
|
# ? Jun 13, 2022 06:39 |
|
sb hermit posted:A function that takes one function and returns another function is generally called a decorator Hello Python guy.
|
# ? Jun 13, 2022 06:47 |
|
Xarn posted:Hello Python guy. rite? i always just referred to them as higher order functions outside of python, though i guess decorators are just a subset of higher order functions
|
# ? Jun 13, 2022 06:53 |
|
DELETE CASCADE posted:the term "lambda" being used for anonymous function (or even by extension to a function in general, as in aws) is the bs cs top 50 nerd's absolute favorite kind of term: gatekeeping jargon whose use is unimpeachable due to association with core theory and the legendary church-turing of yore I still don't understand what's gatekeepy about having terms of trade. Okay, let's say anonymous function instead of lambda. Do lay people now understand what it means? No, you still have to explain why anonymous functions are considered a separate thing, that there is a distinction between named and unnamed functions, the different approaches towards their scoping, the difference between anonymous and nested functions, and so on. What is the issue of just adding "oh and these are called lambdas for short" on top?
|
# ? Jun 13, 2022 06:56 |
|
you assume they remember or were taught what functions are, irrespective of whether they're anonymous or not...
|
# ? Jun 13, 2022 06:58 |
|
lambdas always remind me of insane math programming poo poo like apl function pointers are my jam though. you haven't lived until you've used function pointers and macros to JIT BPF bytecode into cache-optimized kernel mode packet classification routines
|
# ? Jun 13, 2022 07:22 |
|
echinopsis posted:i’m working on every aspect of my site at once and currently i’m thinking about fonts now is it possible to buy a font and host it and ask the website to use that? there are font repositories other than google that have fonts with various definitions of free, but a surprising amount are indeed OFL/free for commercial use. here's an aggregated blog post with a lot of popular ones, no i didn't write it sorry for the listicle https://dev.to/qrolic/15-most-amazing-websites-to-download-free-fonts-1imn
|
# ? Jun 13, 2022 08:20 |
|
i like the term "inline function" since the location they're defined seems more relevant (since their definition location is key to how they work) than their often being anonymous (which has no meaningful effect on how the function operates). never thought about the C tidbit, though that makes sense now to xarn's point though it's not a trivial concept no matter what you call it; there's no concise way to say "a function defined within another function whose lexical scope is the dynamic scope of the defining function, also the definitions of lexical and dynamic scope are..."
|
# ? Jun 13, 2022 08:31 |
|
fisting by many posted:there are font repositories other than google that have fonts with various definitions of free, but a surprising amount are indeed OFL/free for commercial use. oh cheers thanks for this. I am 99% settled on the font for my project, in fact I am happy with it, BUT, I am open minded to it being better
|
# ? Jun 13, 2022 08:34 |
|
sb hermit posted:A function that takes one function and returns another function is generally called a decorator As explained above, a decorator is a higher-order function whose job is to augment an existing function with extra functionality on top of the original one. OO people invented a bunch of "patterns" because their languages didn't support higher-order functions. This is such a simple and non-academic concept that you only need a couple of books to explain them. A constructor is a primary way to create another function based on parts. A copy constructor is the same but the new function is expected to be equivalent to the source. A factory brings in the expectation that the returned function is a subclass of the declared return type etc. Sometimes these names are useful suffixes if you need to be clear what the purpose of a given function is, but that is often less of a problem when they are short and inline. I don't write function incrementTransformer() { ... } when a => a + 1 is obvious enough.
|
# ? Jun 13, 2022 10:09 |
|
CMYK BLYAT! posted:i like the term "inline function" since the location they're defined seems more relevant (since their definition location is key to how they work) than their often being anonymous (which has no meaningful effect on how the function operates) "inline function" has a completely different meaning, i.e. a function that gets compiled inline. that is, instead of the function's code being compiled once into the resulting assembly, and every call site being ultimately a JMP instruction to the function code part, the function's code gets directly copy-pasted after each call site and compiled N times this is useful if (a) you don't care about seeing a reference to the function in debugging, reflection, etc., and/or (b) you need to squeeze a little bit of performance out of your code. the archetypical inlining candidates are one-liners. the classic `array.map (x -> x +1)` can get a lot faster on huge arrays if you inline the lambda so the resulting code looks like `for i in 0 .. length-1 do; push(a[i]+1)` instead of `for i in 0 .. length-1 do; push(lambda(a[i]))`. not only that, but in such an example the compiled assembly will actually be more readable instead of less NihilCredo fucked around with this message at 10:59 on Jun 13, 2022 |
# ? Jun 13, 2022 10:56 |
|
Lol at saying C doesn't have anonymous functions. Someone's never seen someone malloc some space, toss some machine code into it, then return the pointer. Kill me.
|
# ? Jun 13, 2022 13:32 |
|
Xarn posted:I still don't understand what's gatekeepy about having terms of trade. in javascript its gets pretty hard to explain these definitions in practical terms though. for example, none of these functions are anonymous: code:
other than the hoisting, the only really important distinction between various kinds of function declarations in javascript is between arrow functions and regular functions, because that changes the behavior of this, so introducing a whole bunch of jargon that doesn't actually have any practical meaning in this language just confuses people. the exception i guess is closure, because that's of course a frequently used concept and one that's important to understand. there are languages where the distinctions you bring up are important, but it's far from universal. TheFluff fucked around with this message at 16:17 on Jun 13, 2022 |
# ? Jun 13, 2022 15:03 |
|
leper khan posted:Lol at saying C doesn't have anonymous functions. C lets you do whatever you want, it owns
|
# ? Jun 13, 2022 16:40 |
|
Typically in those cases it's whatever your untrusted executable has smuggled in as a payload and has swapped with the stack pointer wants
|
# ? Jun 13, 2022 16:49 |
|
CPColin posted:I've been through the lambda on a func with no name
|
# ? Jun 13, 2022 17:56 |
|
The function with no name is actually credited as "Joe".
|
# ? Jun 13, 2022 18:03 |
|
NihilCredo posted:"inline function" has a completely different meaning, i.e. a function that gets compiled inline. no at best that is an [i]inlined function
|
# ? Jun 13, 2022 18:19 |
|
If you are about to start talking about C/C++ functions marked with inline, then remember that the languages like to used words incorrectly, such as functor, move, remove, co_* keywords...
|
# ? Jun 13, 2022 18:22 |
|
words are made up meanings are based on usage unfortunately. this entails that 'literally' literally doesn't mean literally
|
# ? Jun 13, 2022 18:24 |
|
|
# ? Apr 28, 2024 04:06 |
|
Xarn posted:If you are about to start talking about C/C++ functions marked with inline, then remember that the languages like to used words incorrectly, such as functor, move, remove, co_* keywords... Ask me how I know that inline(always) does not mean always
|
# ? Jun 13, 2022 18:25 |