Hacker Newsnew | past | comments | ask | show | jobs | submit | more BiteCode_dev's commentslogin

The reason AWK is not widespread is that it's only great for one case: working on a stream of lines. It's a pretty narrow niche.

Sure you can code anything with it, but there is always another language that will be better at this other thing, and still decent at what awk does. Awk looks more like a DSL than a generalist language.

So why learn awk to save you a few minutes for the rare cases you do need it? Just learn Python/Ruby/etc, it's a better investment, and it has a better crossplateform story.


> It's a pretty narrow niche.

If you're working on any kind of Unix, it's a niche that you encounter almost constantly.

> Awk looks more like a DSL than a generalist language.

Yes, it is pretty much the ultimate text processing DSL. So if you need to process a text file a line at a time, in most cases AWK is the optimal solution.

> and it has a better crossplateform story.

I think AWK is available on almost every platform where you can install those languages?


Regarding AWK being cross-platform, it is part of the POSIX standard.

https://pubs.opengroup.org/onlinepubs/9699919799/utilities/a...


The reason AWK is so awesome is that it's only great for one case: working on a stream of lines


Honestly at this point I wouldn't care. Give me a kickstarter link with a the poll author as the champion, and I would insta send money.

I can afford a few bucks to help somebody to attempt to solve the problem. I'm even ok with failure as long as it's an honest attempt.


I think a successful way to do this is Neovim's BountySource which was perfectly run, imho. There was a "if it hits $x tarruda will work on it" thing which is all I wanted.


I answered the poll, and said I would pay $50 for this, but never received any follow up (and I think I provided my email, I usually do in polls if they give the option).

Now I just realized that there is a github sponsor link, but it's recurring. I don't want recurring. I want to send $50 once.


I am in exactly the same position. Happy to donate $100 once, but mot happy to sign up to a recurring subscription.


I would also donate 25-50$ to this, but once or twice. No recurring please


You can sign up, pay once, then cancel.


Why should the onus be on me to make sure I don't pay more money than I want? I can't stand this 'just subscribe then cancel' mentality. I would like the option for a one time payment for things without having to fuck around starting and cancelling subscriptions. It's just ridiculous.


> Why should the onus be on me to make sure I don't pay more money than I want?

follow the money. :)


So many companies made unsubscribing too hard that I wouldn’t even try it with github.


I just did this, and it's very easy. After you cancel, GH even puts up a multiple-choice "why did you cancel?" survey, and one of the options is "wanted to make a one-time donation".


Perhaps they should make that an official option at that point…


A lot of people are asking:

- why python?

- isn't is slow?

Remember that Python is a language spec, there are several implementations.

This project uses a particular implementation called CircuitPython ( https://en.wikipedia.org/wiki/CircuitPython), a derivative project from MicroPython ( https://fr.wikipedia.org/wiki/MicroPython), by the people at AdaFruit.

This implementation runs with a very different VM that can fit within 256k of code space and 16k of RAM.

So, while obviously you cannot expect anywhere near C level of perfs, this is way lighter than CPython.

The advantage is that you get the ease of Python to program your board, including the clean terce language, the memory management and the rich data structures. You can even have a live shell on some embeded hardwares! The whole dev process is so simple: code, copy your module, run.

Of course, some features of CPython are not available.


many people dont realize, but micropython has unix port, and it can be much slower than CPython. micropython's main advantage is size, not speed.


Declarative is great, and I wish more people created clean declarative API with regular languages instead of writting yet another DSL.

But remember that the problem with a declarative syntax, is that it needs a runtime, which typically the end user doesn't touch. And if the runtime doesn't take into consideration one use case, the user is stuck. Don't forget to provide an escape hatch.


The other problem with declarative code on a runtime you didn't create is traditional forms of debugging go out the window. You can't set a breakpoint, or single step, or even printf debug declarative code directly, though you can peek behind the scenes a little if you control the runtime.


Yeah, you may debug the result of your declarations if introspection is ok, but god has mercy if the error is at the runtime level.


My impression of declarative programming is that it looks good in the "Hello, world" and other basic examples because you don't have to dip into the escape hatches. But when presented with real-world problems, you end up spending more time trying to get their framework to do what you want through the escape hatches than if you had just written your own program using a normal programming language and a well-designed library.


You can use a normal language to well design a declarative library. That's the point.


You're just throwing terms around here.

Something like Django or Rails, is no longer just a "declarative library" it's a framework. You're using their patterns, and you're limited to their escape hatches.


Never talked about frameworks.

Declarative is just a paradigm, you can use any language to design a declarative API.

Nox, pydantic and sqla are examples of it.


I'm not familiar enough with any of those tools to evaluate what you're saying. :shrug:


Declarative code doesn’t need a runtime if you have a compiler


Even if the language is compiled, you still need a runtime.

GHC compiles to native code, but there's still a runtime for instance to handle the garbage collection, to sort out the lazy evaluation, and to translate the blocking IO API at the haskell end into a non-blocking IO api at the kernel end.

I surely wouldn't want to be debugging my haskell code on a time budget by directly looking at the machine code that is running. I know some people do that and it can be quite illuminating, but the fact that I can debug haskell in its own terms is good.


You're conflating runtime with interpreter. Interpreter translates non-native code to native code, a runtime is what gives you garbage collection, the vm(ex: JVM), std libraries, etc.


And you are not suppose to have the entire rugby team in the scrum, only people who's work intersect.

If currently the designer is not working on the same project than the dev, they should not be in the same scrum.

Keep it short, to the point.

Scrum is not a meeting, it's an interactive tiny bite of field report.

Make it anything bigger than that, and you are not doing agile anymore.


The Daily Scrum is frequently misunderstood - it's actually to replan to remaining work required to achieve the sprint goal not a status update or field report.

It might well mean that you need to bring in the Product Owner to tell them the news so that together you discuss what is delivered to meet the definition of the sprint goal can be adjusted within acceptable boundaries.

If you're wondering why you should accept this definition it's because I recently attended the Scrum Patterns course run by Jim Coplien (the guy who codified the definition of the Daily Scrum and is the co-author of "A Scrum Book" with Jeff Sutherland) and heard it directly from him.


Field reports are meant to replan the remaining work. That's the whole purpose of field reports.

But I understand what you mean: too many people use it to track activity, not as input for the agile loop.


That's the benefit of integrating async in the runtime itself. It abstracts it from the language, which doesn't have to know about it. Just like a GC abstract memory handling.


Right. Even POSIX.1 has the same "messaging" functionality, so:

* spawn/1 becomes fork()

* send/2 becomes kill()

* receive F -> ... G -> ... end becomes sigaddset(&s,F);sigaddset(&s,G);sigwait(&s,&r)

There are of course other issues, like there aren't that many signals, or that memory management is hard, or whatever, but these are solved by other languages as well, so you can imagine this is at least straightforward to implement.

The downside is that it means you can have functions that you can't write. That can be a big bummer to a lisp programmer, but I don't think python, javascript, etc, programmers care about that, so I think history will judge the trend to colour functions as lazy and shortsighted.


Async def are not colored functions in python.

In fact there are not function at all, just like generators are not.

Also coroutines can be called from functions and vice versa. You don't have to choose.

The problem is not the color. The problem is the default paradigm is to be blocking I/O, and you add non blocking on top. It's way easier to make everything non blocking, then add blocking things on top.

It's not a matter of syntax, but of core paradigm.

Go and erlang were designed from the non blocking perspective from the get go.

But even go add to use something to manage async control flow, so it uses channels, which you don't need if you have coroutines.

Erland went deeper and made everything immutable, and baked in actors in the runtime. To me that's more impressive.


Can you expand on your notion of what is and is not a colored function?

I might use this test: When I wish to add a call to a function that yields control other than by returning to the middle of a regular function, so that the latter portion of the regular function can use the results of yielding, do I then have to change the function declaration and every single call site?

You clearly disagree. What test should we use?


It's like calling classes colored functions because you can both call them. Classes are not functions. They are classes.

Coroutines are not functions, they are coroutines. Different primitives.

A function has a single exit entry point and a single exit point and no state. If you call a function, you run its body.

A coroutine has several entry points and exit points, and an internal state. If you call a coroutine, you make an instanciation (the body doesn't run).

You can argue than using coroutine for async handling has drawbacks, but colored functions is not the proper analogy and make people very confused about the whole thing.

The fact the syntax to define them is so similar doesn't help, and I see most people difficulties comming from their attempt to reconciliate models that have no reason to be.

Just like a hashmap and an array are 2 different things despite you can index both, functions and coroutines must be understood as separated concepts.


> A function has a single exit entry point and a single exit point and no state. If you call a function, you run its body.

> A coroutine has several entry points and exit points, and an internal state. If you call a coroutine, you make an instanciation (the body doesn't run).

Sort of, in some languages, but it doesn't have to work that way.

First, let's note that "blues" do have state, and they put it on the stack. So blues can only be entered once and store state on the stack. Reds store state in an object, and they can yield out of the middle and be reentered.

Then let's note that our top-level code has to be "red", or it would be impossible to ever run "red" code.

Now let's go on a journey.

1. Make it so calling a red from a red will start running the body right away, by default.

2. When calling a red from a red and running the body, we're already inside a coroutine instance. Instead of making a new one, keep using the same one. Grow it and store the new state at the end.

3. When calling a blue, if we're inside a coroutine instance, put the blue's stack inside it. And since our top-level code is red, the we always are inside a coroutine instance.

4. Since all our stack frames are safely stored inside coroutine instances, it's safe to call from a blue into a red! The entire stack can be saved for later, blue and red alike.

5. At this point the only difference between blue and red is that a blue function cannot yield, it can only have something deeper on the stack yield. For fun, you could make 'yield' into a runtime-provided function. Now functions written in the language are all the same. There is no difference between blue and red.

-

So there is still a distinction between "coroutines" and "functions". But in this setup, a coroutine is merely a container that you run functions inside of. There is only one kind of code you run, and it is a function.

Some language work this way. I wish javascript worked this way.


Yes but this require the entire runtime to be designed that way from the start.

It cannot be applied to legacy languages.

Just like you could not add a borrow checker to C without creating 2 worlds in the C community. But you can design Rust with this in mind.

A design always has a context.

Also, make a giant coroutine has a performance price, because any line is a potiential context switching.


You can redo a runtime while keeping the actual language the same.

The reason you wouldn't do it in C is that there are so many implementations and only a couple of them will actually update. In most languages the extra difficulty for retrofitting it would probably be less than the difficulty of designing and implementing it in the first place.

> Also, make a giant coroutine has a performance price, because any line is a potiential context switching.

A notable one? You need a stack anyway, and you don't really have to change anything to make it switchable.

You have to avoid taking a mutex and then calling into arbitrary code, but that was already a terrible idea.


Alright. One reason for my confusion is that I assumed you would post "async functions (and generators?) are not colored functions in JavaScript" at the top level if you meant that, since the article is about async functions in JavaScript. So I wondered, what's the distinction between async functions in JavaScript and in Python that makes one "colored functions" but not the other? But this is not what you intended. Thanks for the clarification.

Some programming languages have stackless async functions and generators that work the way you said, and some other languages have stackful coroutines. In the languages I use the most, functions that switch to other parts of the program are functions (according to the type system and the calling convention, but not in the sense that they have only one entry point and one exit point and no state). This is pretty great, because things are composable in precisely the way the article complains that they are not. Given that these things exist, it's fine to say "coroutines and functions are two different things" but maybe saying "a function which jumps to a different stack and which can then be jumped back into is not a function" will just make people very confused about the whole thing.

If you have this, uh, code fragment:

  function read_five(socket)
    local data, err = socket:recv(5)
    if not err then
      return data
    end
    return nil, err
  end
perhaps we shouldn't say "the value declared by the code fragment is a function or is not a function depending on whether recv nonlocally switches only to the kernel or whether it can also switch to an event loop in the same process"


Blog never went away. There are plenty of it, and very good one.

Just like there is still good music today.

The problem is discovering it.

Before internet became a medium for mass sharing pictures of inspiration quotes and kitten, blogs had a change to stand out.

Now, theyr are completly dwarfed by other usages, and most users don't find it a popular format anyway. Search engine rarely put them in top of search results either, because they rarely quickly answer and direct question or provide the popular untertainment du jour.

So if you want to help bring blog back, you gotta find a way to make them more visible, and get people interested in them.

Good luck with that. Videos store instantly became more popular than libraries IRL, and I don't see a reason why suddenly blogs would win against Youtube. Same with equivalent to Facebook, Twitter, etc.


> Apologies to Pushbullet for the rejection after addressed the original violation

Wait, what?

So you have an completly black box ultimatum, and even if you somehow magically guess what needs to be done, if you do it, they can still reject you?

That's worse than debugging IE6.

That's dishonest.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: