Sveriges mest populära poddar

FLOSS Weekly

Episode 790 transcript

N/A • 3 juli 2024
FLOSS-790

Jonathan: This is Floss Weekly, Episode 791, recorded July 2nd. Better bash scripting with Amber. Hey, this week Dan Lynch joins me and we talk with Pavel Korash about Amber. It's a new programming language that's designed to make a bash just a little easier to use. You don't want to miss it, so stay tuned. Hey folks, it's time for Floss Weekly.

That's a show about free, libre, and open source software. I'm your host, Jonathan Bennett, and we've got something really fun to talk about today. But first off, we have a co host, of course. I am not running the show solo today. And it is Dan, Dan the man, Method Dan, the Linux outlaw. Welcome, sir.

Dan: Hey, thank you.

Good to be here. Always good to be here.

Jonathan: Yeah, it's always good to have you. A lot of fun. A lot of fun getting to co host and do the show with Dan. And this show is kind of right up your alley as one of the other Linux guys, because we are talking about Amber, which is sort of a replacement for

Bash scripting.

Not really a replacement. Maybe they should have called it Bash or something like that. Have you gotten some time to play around with it? I haven't.

Dan: Only today. Yeah, I had a look today. We we were talking pre show there about my confusion when I first looked it up with another project, which was completely my fault.

I thought we might be talking about molecular biology, so I'm quite pleased that we're not, because my, my molecular biology is just not Great. It's, it's not quite up to scratch. Yeah, but Amber's a really interesting project. As you said, I'm not sure I'd call it a replacement for bash so much as an extension to bash or I don't know.

We'll have to ask what, what the kind of correct term is.

Jonathan: Yeah. So it actually, it reminds me a lot of I can't remember the name of it, but there's, there's another language that. Is a way to do a little bit nicer CSS. And then you compile it down in actual CSS. And I can't remember what they call that.

But it, you know, it's, it's the same idea. So what Amber, from my understanding, what Amber does is you, you write your bash script in this kind of, a little bit more structured, a little bit nicer scripting language. And then you, you tell it to compile and it will spit out it. Bash code. Or, you can actually run Amber scripts directly with the Amber executable.

And so there's just a couple of different ways to go about it. And I've actually got a feature request already in the Amber github. And that is, boy, it'd be really nice if you could do this with a shebang. And currently you can't because when the Amber program runs and tries to interpret the script, It sees that first line, the, the, the, the hashtag, hashtag, exclamation mark, if you will.

And it goes, this is not valid Amber because it doesn't see the hashtag. It doesn't see the hash as a, a comment. It tries to interpret it as basically like a, if I remember correctly, it tries to see it as almost a pre processor directive. And so it just, it errors out. And so I, you know, I opened up a feature request and say, Hey, it'd be really nice if you could just run amber scripts, like you run bash scripts.

And I think that's coming. We'll get the confirmation here in just a minute. Let's not let's not waste any more time. Let's go ahead and bring the man himself onto the show. Powell. Well, welcome, sir. Welcome. Hello there. Hey, so first off You, you said before the show that we're going to have to forgive your poor English.

And as I said, your English is, is better than a lot of Native Americans that I know. And but where, where, where are you from and what, why would, why would we potentially have to forgive your English? Well, so

Paweł: I'm from Poland, so there's the stigma that many Poles have that pronunciation.

When it comes to like speaking in English, so I don't know. That's just basically I wanted to Clear that out

Jonathan: Well, I I've got to say it is it is not a problem We we do occasionally have guests that we have to work a little bit to understand But I don't think we're gonna have that problem today. So tell us about tell us about amber What what's the problem you're trying to solve?

Like what's the the origin story for this super villain that we call amber? You Okay.

Dan: Superhero. So

Paweł: I'll start with With a moment when I found out that I need Amber. So I was building like some project that needed some automated workflows. And the problem was that it actually I wanted to write some code that is like it can.

Automate some file management and maybe do some API requests, but it never worked out very well. When I was writing it with Python, I was feeling like I'm doing some kind of wrestling with Python. It's not meant to, it's not designed to do this. And so I thought, well, I want to do something like, I probably should use bash because I'm like doing a lot of bash calls and I'm interacting with the STD out and like, you know, managing ever like the data and, and all that stuff.

So I thought, well, let's do it in let's, let's build, let's find some language that can do that. Like some, Something else that is more advanced than bash, maybe something that is more like maybe designed for, for developers, not maybe not necessarily for people that are tinkering with bash because bash as it's Itself feels like it was designed solely for shell interaction.

So you write commands and and, and basically you, you interact with it just like that. Right. Like you write command, you see an error, you. Take a different approach, probably you, you do something else when you write a script in bash when you type a command that errors inside of that script, it's, it's it goes to the next command and that's, that's pretty that's a bummer because I would assume bash would stop when it fails and it does not.

So so that's one problem that I had with it. I didn't want to sit around and debug bash my bash script as it was not very necessary to, to spend that much time on it because like my project requires much more other So I just thought, well, there must be some kind of a language that does that.

And I just, I found out that there is none that I have to I thought I'm going to create such a, such language. And yeah, I spent just to solve one problem that could, I don't know, maybe save me like 15 minutes. I yeah, I sat down and coded this language for two years. Haha. Yeah, . Excellent. But it's, yeah, I was, it wa wasn't like two whole years of development.

It was like more like when I had a free time. 'cause I'm a st I used to be a student as well. I graduated sometime ago, so Congratulations. Yeah. ,

Jonathan: computer science student.

Paweł: Yeah. Computer science student. It was like I graduated with a bachelor's engineering. Degree it was a week ago.

So, yeah. Yeah. So, and okay. Okay. So one, one interesting thought, one interesting thing is that Amber, it was also a thesis for for my

Jonathan: degree. So,

Paweł: yeah.

Jonathan: Yeah. Neat. So the, the Amber language it's, is it written in bash? Have you gotten to the point to where it's written in Amber?

Paweł: No, no, I don't think we're going to do that.

It will be way too slow and way too hard to implement this since bash has many limitations that it just,

Jonathan: it's,

Paweł: it's really hard to, to implement this same thing.

Jonathan: Well, to be fair, I don't think

Paweł: bash is written in bash either.

Jonathan: Yeah, it's true. So what, what language, what language is under the hood? What did you go with?

Paweł: I, I picked up Rust because yeah, it's, I, I doubled with C plus plus, but I ended up with dealing with segmentation faults and I thought, well, it's not for me, I'm just, I'm just going to use Rust.

Jonathan: Yeah, I feel that. I understand that. So. You can, let's see, so we can, we can compile Amber to bash code.

Like that sounds fairly complicated. How does that even work?

Paweł: Well when you run Amber compiler, it reads to the standard inputs. Or maybe you, you provide a path it reads basically the Amber code and. Uh, it tries to parse it and creates an AST, AST it's abstract syntax tree. And it like uses a different modules that like there are trying to detect if the syntax that is, that it's trying to parse is actually this syntax that it's trying to parse.

If not, then it's like letting the compiler to go to, to pick another module. And and works like that. And it creates this tree that is then that the translator module is trying to yeah, basically iterate through the, all the notes and, and translate it to the bash. So this is how it works.

It's pretty simple. I think it has the. Only two phases. So it's basically parsing and translating. It's yeah, I think it's enough for that, for, for

Jonathan: this reason. Yeah. The, the, the bash code that it spits out is that I would almost expect that it would be not particularly pretty bash code. Like it's got, it's gotta be a little extra verbose to be able to get all of the, well, to match the features that you've put into Amber, right?

Paweł: Yeah, that's true. So basically Bash does not support importing separate modules. I mean, it does via sourcing files, but I wanted to I don't know. I just wanted to prepare myself for maybe because like we could have different files that have the same variable names or the same functions that are being exported, and since we don't know if there's going to be a clash, because you can import the same function from two different files that have the same name, With as keyword, which, which changes the name of the function.

So we can like import foo function from the both files, but you can change the name and the, when you import. The function and the source code to like a or B, right. And you have two different functions that do different things. There are from two different files, but they have to exist in the same like space, right.

They cannot override each other namespace problems. Yes. Oh yeah, exactly. That's, that's the main reason why you might see the weird numbers and, and resulting bash file. However I think that we, we can improve this. We can Frank for instance name the, like add the numbers only when there's some kind of clash.

So this would, we'll basically preserve everything that it is like to make it human readable. And then we'll like try to find out where the clash could potentially be, and then add some kind of numberings or, or I don't know, maybe Maybe append a path to the file that this function was used in or

Jonathan: whatever.

Yeah. And so with Amber, you can, so you can, you can compile it down to bash scripts and run them that way. Can you run Amber code directly?

Paweł: Yes, it's, it's. It actually compiles to bash and it runs like it invokes a bash and it's just that way. So there is no interpreter. Um, if we, yeah, yeah. I was thinking about making one, but I thought that not for now, at least maybe in the future for now, it seems like an overkill.

Jonathan: Yeah. So I was, I was going to go down this rabbit hole of asking a question about like, does the What, what the Amber interpreter, assuming that there was one, what it does with the code, is it exactly the same as what Compiling it to Bash and then running it through Bash would do with the code. And then, you know, you have this, like, you probably would need this big test mechanism to run through a bunch of edge cases and make sure that your interpreter is going to do the same thing that your compiler does.

And, like, languages have taken that route. It's just, it can be a lot. Yeah, it's, that's true. I took the easy way, so. There is, there is something to be said sometimes for the easy way. Yeah. So. Yeah. You started this originally to, to solve a, to solve a problem. Are you actually using it? Do you make use of Amber yourself to, to, to, you know, maybe even you in your day job to fix things?

Dan: Hmm.

Paweł: Well yes, I at my at work I use, I have this like kind of a script that is also, that is like. Turning up my IDE that is opening up my browser that is also setting up because I'm a web developer and it's like boots everything up and also create some aliases for, for different commands for Git commands and all that stuff.

So I use it for that. And also we have written an installator. Insulator installer for Amber in Amber. So it's pretty, it's pretty interesting to, to see that we net, we didn't like write the compiler itself in Amber, but we all, but we have written an installer in Amber. So I think that's, that's an equivalent of writing compiler in the same language.

Yeah, we think so. Cool.

Dan: Yeah, that sounds, that sounds excellent. I was interested in obviously you're targeting bash, which makes a lot of sense. Is there any plans to look at any other, any other shells like fish or any of these other fantastic ones that people are into or are you focused on bash?

Paweł: Well for now we're actually want to, because bash is the most like popular option it's installed, it's pre installed in many distros and I think that targeting bash is a good idea. However, some people may not want to use bash and for that reason, for the maximum portability and yeah, we want to also probably in the future support SH itself.

So, so that you can run the script anywhere. And most of the shells that are like custom shells, I think they support SH out of the box. So so we can also, yeah. So we can basically compile the same script to, instead of bash to just compile to sh and it should be good. The sh also lacks many features that bash provides, such as arrays and associative arrays and and many other things.

And that would be a pretty tough thing to, to, to come around. I mean I think that developers, I mean, either we should figure out something to to work around, to work this around, or the develop, we were just going to hand it over to developers and say, oh, you're using array. Well, it's, if you're compiling to a Sage, it's, you're in, we're unable to to translate that.

So we'll have to figure it out. Maybe some ideas will arise, but yeah, we'll see, to be honest.

Dan: Makes sense. Now I noticed you said the, the, the word we there as we'll have to work it out. Is it other people working on the tool with you or do you have a team?

Paweł: There are a couple of maintainers that are also on board with us.

So when okay. Before the, the whole, like when, when Amber got popular there was only, I mean, only I was like working on it. And so the development of it was pretty. Slow because I also didn't have time every, every day, like to, to sit around and just, you know, at least type one line of code to keep this, keep pushing this project.

Yeah. So that, that was very very good that I was very blessed that so many people came around and started, started building pull requests and, and right now they're like. I think five maintainers besides me. So

Jonathan: that's good. Yeah,

Dan: that's, yeah, that's quite a lot of maintainers for a, you know, a new project, such a new project.

We've seen other projects in the past that have ended up with one maintainer who's then disappeared. And then, you know, obviously that's not good. But yeah, that's awesome. So, um, you mentioned that you, you, you have a team working on it and stuff. Do you have any idea how popular it is in the user base?

How many users? I mean, not in numbers, it's hard numbers, but is it, has it, has it exploded in popularity for you?

Paweł: Yeah, I mean when it comes to the overall installer in installs of Amber, they're like, 2, 500 or so, something like that. When it comes to the visits to the website, cause I, I'm also like trying to, I also track these, these numbers just to see what can I improve?

What, what's what is most interest interesting for users and all that stuff. It seems that there's like. 40, 000 so far visits to the website, which is pretty interesting. But overall I don't know. I'm I think that as we move on, as we add features, as we patch some bugs people are more likely to, to hop on the train and start using Amber.

Not sure if if that's enough, I think we're, we're going to improve it even more. And maybe at some point there will be at, at a stable release, maybe some people will, will, more people will, will come and use it.

Dan: And what about the, the kind of type of users that you see? Is it mainly power users or is it good for people who want to learn?

About bash or what's the kind of spectrum like that?

Paweł: Yeah. So there's two different types of users. Yeah, that's their power users that are also looking for an alternative to just write some scripts that are perhaps updating their system and, and, and the backgrounds, or maybe some kind of a bot detector that a, a script that checks if.

The connection that is created with the server is a bot or not. And well, there are also some people that wanted to use it in, at work for managing some small environments like Some kind of Docker containers or maybe some, some, some small environments that do not have enough maybe space and memory to install Python or any other external tool, but also they need to automate some things and To use bash, it's, it's like, it's, it's not that convenient.

So they choose to use Amber and just compile it, compile the code and send it to, to this law, to this little environment. Yeah.

Dan: Wow. That's very cool. So you could also. I'm wondering about like embedded spaces. Like that's what you're talking about. There is like embedded areas possibly as well. I know dockers not necessarily, but I was thinking about like, maybe people would use it for small devices, as you say, like and target because you, a lot of them don't necessarily have.

enough room for, for, well, they have room for bash, but they don't necessarily have room for a lot on top of that. So how, how much kind of, could I, obviously you can generate the bash and send it, as you said, then how difficult would it be to install, install Amber on, on a small device? Does it need a lot of resources?

Paweł: Well, the thing is that you don't have to install it on a small device. You can just compile it on the, on your computer, on your machine, main machine, and just send it to the, to the little device that you have. To the smaller device and you know, debug it and see if it works. And develop the code this way.

It's it's a good alternative, I think.

Dan: Yeah. Yeah. That makes sense. So I was interested in some of the, some of the advantages that you get from, from using Amber, because as we mentioned at the top of the show, Jonathan has been using it. I've, I've I've not unfortunately had time to do much with it, but I will be after this.

Don't worry, I'll, I'll certainly be trying it out because I was looking at things like you've got like type safety, which is interesting. So Amber can help you, I can help you with better scripting practices in some ways that is that fair?

Paweł: Yeah. When I was building the, the language, I was thinking that, well, it will be cool if this language also supported libraries, like building libraries out, out of the box.

So people could build some kind of like ready solutions for for given problems that are also typed so that the users of these libraries can, See what the function requires, like for example, number and text or whatever. And and that would be cool because I wanted Amber to be more of a automating solution, not necessarily a wrapper for bash.

It, we have to start somewhere. So, so Amber is, is pretty limited at this point. But I think that once we progress the the whole ecosystem will start the, the whole type safety will make more and more sense and people will be able to, because right now they're only primitive types that can, that people can use.

And I think that if we. As the, yeah, as the time goes on Amber will gain some kind of, um, some way to create types, many types, like for instance, for exit codes for different maybe enums or whatever we'll, we'll have to discuss it on, on GitHub probably because It would be nice to, to get the feedback of the people that actually use it.

So, yeah, but that's, that's the, that's the main idea behind this.

Dan: That's awesome. And, and what was there any languages that you looked at that we particularly took like inspiration from when you were trying to create Amber?

Paweł: I was inspired by. Mainly, mainly ECMAScript, which is JavaScript, mainly because it's super popular and people are familiar with the syntax.

I also liked the some of the Rust features like I like that loops and Rust I mean, at least the infinite loop starts with the keyword loop. And it was like, it, it makes sense. So I, so I use that as well. And instead of string, I decided to choose a different name for, for string. I decided to use text because I wanted to give it a little bit of personality and, and, and it's, it's own vibe or its own flair.

So, yeah, so that's, That's the reason that these are the languages that was inspired by.

Jonathan: I'm, I'm curious if there's anything. So it comes to mind that you could, if somebody really wanted to, you could do something crazy like use Amber as a replacement for PHP and write out websites with it. Like, there are some interesting, and I don't know that that's a good idea, that anybody would do it, but like are you sort of thinking about like this, maybe having a life beyond just writing writing shell scripts?

Yeah, I

Paweł: was thinking about, because you have this GitHub workflows and GitHub actually, no the GitHub webhooks or something like that. Well, basically it's this tool that can make an REST API and, and, and do a request. And I was thinking like, well, that would be cool to create some kind of a simple HTTP server that can X accept some GitHub requests that it sends and, and do some automations based on it.

So I think that we're actually going to do some kind of a server ish things. Maybe, but, but that's probably In the future, probably distant future. We don't know yet. Um, maybe that will be some kind of a, a separate project that is not a part of the compiler itself.

Jonathan: Yeah. So I'm, I'm also real curious is everything that Amber does.

And so I guess there's a two part question about what does it do right now? And what are you looking to for the future? Is everything that Amber does just Bash and the built ins or is there anything that like has to make a call to SED or AWK or GREP? And if so, or if you're ever going to do that, how do you, how do you handle the dependencies on that?

Paweł: Well, that's a good question. We, for now we actually use, we depend on BC for handling numbers. BC is a basic calculator. It's basically a. Arithmetic calculator with decimal precision. But yeah, we want to I, I think that we want to get off all of these dependency dependencies to the maximum because just to, just to improve the portability of Amber.

And we'll probably find out some custom solutions for that. For instance, when it comes to numbers with floating points, because bash does not support floating points, we could use some fixed precisions some kind of like functions under the hood, just to, just to at least emulate it in some way.

But yeah, that's that's that's, that will be a tough tough task to do. We'll see if it's possible to just ditch everything and, and everything is going to be all right. For now, Amber does not use like a lot of dependencies, so it's not the best, it's, it's not going to be that hard to, to accomplish.

Right now there's like sed, sec and BC. Yeah. As the dependency. So it's not a lot. And I think we can cut some of these off and

Jonathan: it'll be good. Again, I'm not going to tell you that this is necessarily a good idea, but something that comes to mind, you could actually write a Amber helper for, you know lack of a better term.

And those bits that you need from sed and the bits that you need from you know, bc could live in this little helper binary. And that actually could be really interesting in moving away from bash into other languages. That might be a way to approach it. Is that something that's on the radar? Yeah, that was my idea, actually, thinking

Paweł: about it.

There you go. Yeah. But the problem is that you're actually installing some binary in the end, and that might be hard to, you would have to maintain many like many targets, compilation targets. Yeah, I heard from people that it's not the best like they don't like the solution for this They would prefer to use some kind of shell scripts shell code embedded But we'll see I think that if there is nothing we can do we can always ship the binary and see how it how to how it works

Jonathan: Yeah, I suppose that sort of defeats the idea that You want to just export, you want to, you want to compile to bash code that doesn't require And you also

Paweł: have this problem that whenever you run the, the, the, the Amber code, it has to fetch from the internet, the binary or from, from somewhere.

Or if we embedded the binary into the shell script, it becomes unreadable, which is also a, a Yeah. Yeah,

Jonathan: it's a deal breaker. Yeah, it's a, it's a, it's a challenging, challenging problem to try to work around. Yes. Okay. So how does, how does Amber handle the, I'm, I'm still, I'm still kind of trying to wrap my head around the way that the language itself works.

Because in, in bash, so just for instance, in bash, you can just, you can go from bash scripting like in one line to directly to, and then here's the program I want to call with all of its arguments. How does, how does Amber handle that? Can you just have a, you know, a call off to a binary as aligned by itself or does it, does it require a little bit more syntax than that?

Paweł: Well there's this command syntax that enables you to call anything from bash. So whatever you, your rights. And the aim and the command expression, it's basically a, you write a bit between two dollar signs. It's like a, like a, like a string, but it's for, for bash, for execute, executing bash. So your rights.

The command here, and then it requires you to also handle the error because in Amber, there are entities that can fail and there are entities that are safe. So the failable entities, which are, which are for instance, the, the commands or functions that are failable, failable, because functions can also fail.

And that is also something very interesting about this. You have to also handle it somehow. And there are many ways to, to, to handle the, the errors. You can write the failed block, or you can, you can write the unsafe, which basically treats this command as if it would never fail. So it's usually for, for, for the times where developers is like, I think that it's, it, it's never going to fail.

So I'm going to just leave it like,

Jonathan: like that. It's like running cat. It. If cat fails, you've got bigger problems on your hands. Oh, yeah. Unless the file permissions are Well, okay, so there's, there's, there's a few cases there, but so we have a, actually a question from the chat room. Mashed potato wants to know Is having a good understanding of Bash recommended, or can one just jump straight into Amber?

This reminds me very much of the question, do I need to learn C before I learn C

Paweł: Well unless you don't want to run many I mean, it's, it's always a good nice to have to, to, to know some basics of bash or at least some SH or how to run commands. But other than that, you don't have to like know every single, like every quirk about bash.

You can just invoke the basic commands that you need. And for instance, assign the results from stdout from, of, of your commands to a variable and just, you know use a standard library. That is also an experimental as of right now. But in the future, let's say you could use the standard standard library and just, you know, manipulate, manipulate the data the way you want and, and I think that's It's, it's pretty powerful because the syntax is very easy easy to, to pick up and, and I think yeah, it's, it's okay to, to, you can start with it and, and see if it's easy for you enough

Jonathan: yeah.

So I want to ask about some. Odder places that people might try to run Amber or at least that I immediately comes to my mind to think to run Amber and so the first one we we mentioned it briefly earlier and that is the idea of embedded places So like on my router running open wrt or other other places Places like that.

Instead of an actual bash, you may just have BusyBox. And I'm curious, do you support, is there, is it going to work, or is it just going to fail spectacularly trying to run the exported code on some place like a BusyBox install?

Paweł: Oh, I never tested it. Not really sure. But my guess if it has,

yeah, I'm, I'm, I'm not, I'm not really sure about that, but I think if it has bash install, it should work. Yeah. I mean, unless you do something. I don't know, you mutate some you, you, you I don't know. You try to create some, something you do, you try to do something that is legal or

Jonathan: yeah. So the crazy thing about that is that BusyBox, BusyBox is an all in one binary.

For embedded devices, embedded Linux, and it, you know, it behaves differently depending upon what command you call it with, but they're all symlinked down to BusyBox. And one of the things that symlocked, symlinked to BusyBox is Bash itself. So, you know, you're, you tell your system to, you know, run this with Bash, and it's actually BusyBox that picks it up and runs it.

And you know, on an embedded device like that, you're probably not going to have sed or grep. Maybe, I mean, you can compile them, but you know, we're talking about targets that four megabytes of flash, it's a little minimal in the future. Ideally, I think that you would compile Amber to SH and just, you, you would just run it with the BusyBox.

Yeah. And you, you, you kind of imagine that anything that SH supports, hopefully BusyBox is going to so yeah, I, I guess officially have a bug in your ear that when you think about doing this also do some testing with BusyBox.

Yeah,

cuz it'd be fun. It'd be fun to run run amber scripts on on open wrt on the router.

Yeah. Yeah Now what about some other even crazier places? What about the BSDs? Are we are we thinking about being able to run amber on OpenBSD, FreeBSD,

Paweł: NetBSD? Yeah. I've heard that some commands that we, that we use are not supported on BSDs out of the box, so we'll probably have to double around this.

But, you know, I'm not really sure if that is that hard to integrate BSDs into with, with with Amber. I think that. Um, it's not going to be hard. It's we, we just have to like I mean, we could, we, we don't even have, have BSD version comp like the, the compiler is not built for BSD as of right now.

We can, we could add the targets and, and then try to see if it's, if we can support it and all that stuff. For now, the only BSD that we support is Mac OS. Which is not a BSD, actually. It used to be, but

Dan: yeah. Yeah,

Jonathan: it, it, it kind of is, but it kind of isn't at the same time. Okay. So let's get crazier.

What about windows? Can we, can we run, can we run Amber on windows you know, Sigwin or PowerShell or even the old school windows command line? Oh gosh. Amber on

Paweł: DOS.

Jonathan: So,

Paweł: yeah, I was thinking about it when I was creating it and I thought that if I catch the catch the two things at the same time, I'm gonna I'm, I'm probably gonna fail.

I have to like focus on one one target and, and, and, and, and, and, and, I think probably we could, we could support it. Why not? I think it would be a really good idea to, to, to support it so that people can build like libraries that are, that are not unique to POSIX operating systems that are also working on Windows devices which would be really cool I think that as of right now, we don't support, PowerShell and command line we'll probably do, but in the really distant future, and we'll also have to check if it's actually viable and if that many people.

You would, would rather use Amber instead of PowerShell because PowerShell is pretty, pretty interesting. Like it's, it's very powerful. And, and I see that it has this object oriented, like paradigm to it that is very compelling. And I think that Windows users would prefer using PowerShell for that exact reason But yeah, we'll, but we'll see.

Maybe, maybe Microsoft adopts Bash and we don't have to worry. That,

Jonathan: that would, that would be lovely, but I'm not going to hold my breath for it. Where, so where, where, where Amber on Windows would really be helpful. Is for those of us that are primarily Linux geeks and we have to go do something with Windows.

And yes, PowerShell is powerful, but it's sort of also painful to work with if you're used to bash or something else. Mm-Hmm. . And then I was also gonna say it, it sounds like the, the direction that, that you want to move with this is where Amber is just eventually going to have a, an option where, you know.

Dash dash target and then you say bash or sh or you know, BSD or fish or PowerShell and then alternatively if you don't run it with a target, it's going to try to detect like what what shell it's being called from and automatically spit out the, that flavor of, of of shell script and I assume that's kind of the direction you want to go and that that's going to, it's going to be its own set of challenges, but it's also going to be Pretty neat when it gets finished.

Paweł: Yeah. For now we are, we'll start with just the SIH and bash, the SIH being the most minimal, but yet more. Portable solution for a portable target for fish and ash and CSH and bash these. I'm not really sure, probably maybe because like we would have to wait and see how fast we reach the limits of bash and then probably we'll just.

Uh, we'll just, okay, say, okay, that's enough. I think this is like as good as we can go and we'll probably support different other targets. For now, I think it's good enough to support Bash and SH, but we'll see if, if adding more supports will actually help Amber to to be more popular and, and, and useful for other people.

Dan: You mentioned the object oriented kind of things that PowerShell can do. I Is the, is there any plans to go in an object oriented kind of direction with, with Amber at all?

Paweł: I think that it's not necessarily e important to, to go with the object oriented paradigm with Amber. Mm-Hmm.

because shell scripting is. I mean, usually when people ask for OOP, they mean something else than they actually ask for. Usually it means that they need some kind of way to to structure things out. Like they want to have a proper structure of, of their of their code. code base so that they enclose some things in given class and they use them as static methods or whatever.

But on the other hand, I think that OOP delivers some, I mean, I'm talking about the inheritance part and all that stuff, not talking about structures and like, The, the like objects, because like, this is very common think that, that I think we should support a neighbor in the end, because so far we always support uh, tables and I mean, erase and a table is a Polish term for that erase and and yeah, and that's basically it.

So yeah. So I think that inheritance is not very important for Amber maybe traits or something else. We'll have to figure it out. What is the best solution for for shell scripting environment. And I think that's. As we go, as we discuss different ideas that we'll finally find something that suits Amber the best.

Dan: So I noticed that when I was looking at the GitHub repository, that you're, you're licensed under the GPL V3 which is one of my, well, Possibly my favorite license. I'm sure everyone wants to know that, but was, was there a lot of thought behind that? Did you, did you just pick a license at random or was, did you, did you just specific?

Do you know what I mean? Some people are just not interested in the license and they're like, I just want to get on with writing what I'm writing and whatever the default value is, that's fine. So is it important to you that people are sharing the code and, and GPL?

Paweł: Yeah, I, I just want Amber to be to be for people, not for, for, for me or whatever I want this tool to be just, um, that, that it's widely that it's easy to, to fork easily, easy to, to integrate with other platforms that require GPL three and that I just want it to be the most friendly license that it can be, that is also yeah, just, just wanted, just wanted that.

Dan: Yeah, that makes sense. That makes total sense. We've actually got another question from the chat room. From The Benton, who says Bash and scripting in general tends to be very iterative. Does Amber support any map slash reduce style functional approaches to scripting?

Paweł: Oh, that would be cool. That would be really nice to add.

We haven't actually done it yet because functions in bash are not I mean, you, you, I mean, you, you actually can treat functions like values, but. With, with the, with the, with function names, like you could create a function with certain name and just evolve it you know but I think that yeah, that would be cool to create a functions to make functions.

Actually values and to assign it to a variable and then like add lambdas. And when you create a map, you could pass a function to a function that could, you know, to a function call that could iterate through all of that, all of that data set that you have and do something else with it. So higher order functions are on the list.

It's there's actually an issue for that. And I think we'll, we'll have it. We'll, we'll introduce it eventually.

Dan: Excellent. There you go. So I hope that's answered the question. The Ben 10 back to the I, I'm a license geek. I love licensing. So I'm just going to bore you with that. I'm afraid.

No, no, I won't bore you. Final question on licensing. I promise. Could you relicense the, the code if you wanted to, do you have anything like a contributor license agreement or is that anything that you would you or does everybody retain their own copyright and all that sort of stuff?

Paweł: I'm not familiar, familiar really with that.

So

Dan: in terms of like the Linux kernel, for example, the developers all contributors who write code retain their own copyright. So that means that no one entity can relicense the kernel, for example, because, Because the copyright is, you need to get agreement from, in terms of the kernel, well, how many people, a lot of people, in terms of the kernel.

Yeah, it's,

Jonathan: I'll jump in and say a couple of words. It's something that's, I've seen a couple of times when a project gets down the road and they go for, for, Several different reasons. They'll go, oh, we went with GPLv3 and we should have gone with MIT. Now, sometimes it's because they want to commercialize and make money.

Other times it's because we just realized that this was a bad decision. So something like a CLA it, it essentially, it's whenever, when somebody writes code, they assign a copyright to whoever holds the CLA, and it says you can re license it if you want to. And there's, there's strong opinions on whether CLAs are a good thing or not.

Because like I said, a lot of times they get involved with commercialization, and people get very unhappy about that. So I'm guessing based on the fact that that CLAs are not in your wheelhouse, not something that we have with Amber.

Paweł: No, I mean, I don't see a compiler that is commercialized. I mean, compilers should be free and easily accessible to people.

Maybe some products around Amber could be like, there could be some products, right? Like that could be, you know, commercialized, but not the compiler itself, I think.

Jonathan: Yeah, that makes sense. I was going to ask whether you have plans to try to ever make any money with Amber or if it's just always going to be a pet project.

It sounds like there's been at least a little bit of thought gone into that. Yeah. Yeah. I mean, I was, I was thinking about that because like, it's nice to have stars and GitHub but if you don't get money, right. I think There are some plans to maybe build some platforms that utilize Amber in some way.

Paweł: Uh, but there are no many, there are no, like I, I, I haven't thought about any particular idea to to implement as of right now. So maybe that, maybe something related to Amber could come up but I don't know. I, I just haven't, I, I'm focused on the compiler right now and I want to make it the best it can be.

Jonathan: I, I assume if somebody came along and said, Hey, let's give you a contract to work on Amber for a year, you'd, you might be interested in that. We could, yeah, I think I would be interested. Somebody, somebody would, somebody from the project would. So what's the what's the, the, the game plan as far as trying to get into the various Linux distros by default?

Thanks. I just looked on my Pop! OS machine here. I can't just apt install Amber, or if I do, I don't think it gets the, I don't think it gets you guys. I think it gets one of the other projects. Have you, have you been in contact with maintainers? Are you, are you talking about that with packagers? Yeah.

We already have a snap package for Amber. So you can go to the snap store and snap craft store. I don't know how it's called exactly, but yeah, you can, you can grab it from there. Okay. We don't have any PPA created as of right now, but we, like, I'm open to people creating some repositories and we could we're, we're also thinking about creating an organization on GitHub to store everything.

Paweł: There. Related to Amber. Mm-Hmm. .

So yeah, it's like, it's the early days right now and I think that as we move on there, there are many, many packages will come up and like for instance, there's already some a UR for arch Linux users that can use that can install the amber. It's called, I don't know, it's, it's probably on the readme on the repository.

Jonathan: Yeah. So let's see, first off, that's interesting that you're, you're using snaps. It's actually one of the, one of the few, one of the very few compelling use cases for using snaps because you can, you know, as opposed to, to some of the other images, you can use it for command line command line stuff.

And it just works. There's one of the things that they kind of had in mind was snaps. So that that's, that's fascinating.

Paweł: We'll also probably create some taps for macOS users. It's like homebrew is the main main driver. Yeah.

Jonathan: Yeah, I would I would imagine it'll be reasonably easy to get into brew They seem to be pretty open to new packages and people, submitting, And it's fairly easy to just download the download the binary and install it manually, isn't it?

Paweł: oh, yeah, sure you can basically, go to the repository go to the releases and there are plenty of You archives that you can download and use the binary. It has no dependencies, so you can just download it and use it.

Jonathan: Yeah, that's neat. Let's see, so if somebody wants to come and get started, what's the best place to come and find more information about Amber the Project?

Paweł: Mm, probably the documentation. We have the doc stats aims slash lang. Aim lang.com.

Jonathan: Mm-Hmm. ,

Paweł: which is the documentation website, which is very, like, it's, it's the place where you wanna learn, aim. We are working on it to make it the most informative and, and educational. Mm-Hmm. , but other than that, you could join our discord server where we're talking about like, there's a channel code help where you can get some help from other people that already code in that, in, in Amber and I don't know, maybe GitHub discussions.

That's also something someplace that you might be interested in. Yeah. I think that these three sources are the best.

Jonathan: Yeah. Now, okay. There's something that we pretty probably should have mentioned or talked about earlier, and that is you've got a, you've got a warning in a couple of different places that Amber is not ready for production yet, right?

What's the what's the story on that? And like, at what point are you going to feel good at like good enough about Amber? Like it's, it's ready. It's not necessarily done, but it's done enough that you can take that warning away. What's the timeline look like?

Paweł: I think that when we stop introducing breaking changes, that for sure, because for now we're, we have a couple of ideas that would break the, the, yeah.

Sorry for that, that would introduce breaking chains for, for existing source code written in Ember. I think that yeah, mainly that, and also if we improve the code coverage, because for now we, we We have some tests, we have many tests, but, but it's not enough for a compiler. I think that we need to cover as much as possible scenarios.

Jonathan: Yeah. Yeah. Makes sense. Um, all right. Is there, is there anything that we didn't ask you about that you wanted to cover? Oh I know it's a hard question.

Paweł: Well, maybe uh, the, like the end goal of Amber is I could I could make an analogy that Amber is supposed to be something like Apple shortcuts for Mac OS.

Hmm. In a way, not necessarily like one to one one to one tool, but, but in a certain way, like for instance it's, it's not going to be like this nice user interface, uh, application or tool or whatever, it's going to be just the, just like, oh my goodness. I'm just like trying to, yeah, exactly.

Exactly. I think that it's the idea of it, but, but it's not the implementation. It's meant to be easy for developers. And it's meant to be for developers and power users, but it's not meant to be like closed and very limited. So it's open for people to extend it with libraries and, and, and maybe applications that interact with other applications.

And this way people can automate many things, but not necessarily So, so it's, so it's like, so, so that's something very Very interesting. Maybe that's, that's the, the idea that I had in mind. That's what I want to say.

Jonathan: Makes sense. Makes sense. So you, you've got the Discord where people come and ask for help and show you some code snippets on GitHub as well.

What's the, what's the strangest thing that somebody's doing with Amber that, that you've seen, that you're aware of?

Paweł: Okay, so one of my friends has written a tic tac toe in Amber, which is pretty interesting. It was a fun little game. Okay. Some other person has written a a script that searches the Bible.

When you, like, write a citation from the Bible, it just searches from the Bible and it spits out where it was exactly, which paragraph and which yeah.

Jonathan: Very cool. All right. No, that's, that's a lot of fun. So I've got, I've got two final questions that I've got to answer, got to ask you, and that is, what is your favorite text editor and scripting language?

so much. Oh, okay. Can I say Amber or You're allowed

Dan: to. Of course you can. If

Jonathan: it's, if it's true. And so that may not be the case yet. I don't know. I could, I could see this where it's a, it's a passion project, but it's not quite your favorite yet. It depends on

Paweł: if if other languages like TypeScript or if these are actually scripting languages, because I use them not as type of scripting as Right, right.

Scripting languages more like I use them more as of, Like a tool to create, to build applications. So I, I would say, I would say Ember. I don't like Python that much. I know that that's a controversial thing to say, not a fan of white space indentations. And sure.

Jonathan: All right. Okay.

Paweł: Yeah. When it comes to, text editor, right? Text editor. I use Zed. I love it. It's just, it's really fast and and it's not that, I don't know. I just, I, I used to use visual studio code, but I've, I found it's very like. I don't know how, how to, how to describe it. It's, um, like not commercialized, but it's more like corporate sound like that.

And I didn't like this vibe and I just wanted to change it to something else. Was looking for an alternative for years and finally some, someone created that. It's on macOS only. So it's kind of a bummer, but yeah, it's, it's true. It's a good tool. Yeah. And I used to use, when I don't have the access to, to Zed, I usually use Vim.

Jonathan: So, yeah. I didn't recognize Zed at first, but now going to their website, it's like, oh, that's, that's the one made by the guys that made Atom. That's right. Yeah, that's exactly.

Paweł: I was a fan of Atom. I just, I, it was too slow. So I switched to VS Code when I, when I heard that they created Zed, I was like, oh, that's, let's give it a shot.

Let's jump, jump there.

Jonathan: Yep. Yep. Makes sense. All right. Whoa. Thank you so much, sir, for being here and really, really enjoyed it. And once you hit your 1. 0, we'll have to have you back and chat about what changed between then, between now and then. Looking forward to it.

Paweł: That's great. Thank you. Thank you so much, sir.

Jonathan: All right.

Dan: What do

Jonathan: you, what do you think?

Dan: I think it was great. Yeah. Really, really interesting project. I've actually, I was going to install it while we were talking, but then I thought maybe not a great idea on the machine that I'm actually talking to you on as we're doing the show, but I will be doing it right after, but it's literally like a curl command to install it.

And so yeah, so that's really, so I'll give that a go. Yeah, I'm really interested. I, I love. Doing stuff with bash, but it's bash has a lot of problems and it's old. It was, I actually looked up earlier. It's, it's like 1980 something it originally came out and yeah, it has, it has its issues, but. I, I think being able to use something like Amber to compile into Bash, I could see real benefits for me doing that.

So yeah, I'm definitely going to be playing around with Amber in future, I think.

Jonathan: Yeah, so one of the fun things about it is it's, I believe you said it's, it's written in Rust. So it'll, it'll run anywhere where you can run Rust and Bash, which is like. Every Linux out there, just about, so I mean, you could put it on, you've got Termux on your Android phone, you could make it run there if you have, you know, we talked about a router, if you've got a router that's got enough flash room on it, you could totally run it and make it work there, you know, if you had, if you had a full bash to make it work and that's, that's, that's really interesting.

So, you know, there's potential to put it on RISC V devices, on ARM devices, all kinds of stuff. Yeah, yeah. Sometimes as much as cool as bash is sometimes bash scripting. It's just It's just not very nice. Every once in a while. Not to throw shade on it, but it's just sometimes it's not my favorite. Yeah, I enjoy Ember a lot.

I think it's going to be very interesting to watch the project though, because they've got, like, they've got some problems to try to move in the direction they want to move. There are some, there are some challenges. And it's going to be really interesting to keep an eye on it and see, like, how do they solve those challenges?

What, what direction do they take with it in the future? Yeah, and I think it's impressive that they've already got five maintainers. That's amazing. That is, well, and I'll tell you, I'll tell you why. I can tell you exactly why that is. Two, two reasons. One, the idea of Amber is it's sticky. Right, like you, you, you hear it and you immediately go, Oh, oh, that's interesting.

And it kind of sticks with you, right? And the other thing is, the people that use it Our programmers, just by the very nature of it. And those two things together is going to attract a lot of people, well, people like you and me, that are interested in it, and, if there's something about it that bugs us enough, we can go fire up, you know, our favorite editor, grab the code, and Go fix it.

And that is how you end up with a project that has five maintainers is because you, it's kind of this, this, this perfect meeting ground of the right project. That's going to attract the right kind of people to be your maintainers. That's very true. Yeah. That is when you said Amber is sticky. I was thinking of Amber, you know, as in Amber itself is, is sticky.

Dan: So you, you, you've really nailed the analogy there. Yeah. Yeah. That's great. They should work that into their marketing somehow. Oh, all right. Dan, you have anything you want to plug? Yeah.

Yeah, I mean this weekend, it's the Liverpool Makefest, which I've talked about in the past. If you can, if you're in, if you're in the UK, if you're near to Liverpool, you want to come along.

It's completely free. It's on all day from 9 a. m. to 5 p. m. this Saturday, the 6th of July. If you go to liverpoolmakefest. org, you can find out stuff on there. And you can make yourself free. Come along, make robots, do drawings fly balloons is a thing we're going to do. Oh, cool. All kinds of stuff.

So yeah, go and check that out.

Jonathan: Yeah, very cool. It's, it's a little bit too far of a drive for me. I don't think I'll make it this year. But maybe Excuses,

Dan: excuses. I know, I know. Mind you, the amount of times I've been to Oklahoma is, is, it's not high. So I, I can't really complain.

Jonathan: Oh, true, true. All right.

Well, thank you, sir, for being here. I appreciate it a lot. No problem. All right, and then as far as things I want to plug, of course, we appreciate Hackaday giving us a home for Floss Weekly, and you can find my work there, specifically the security column. It goes live on Friday mornings, and that is a lot of fun.

Make sure and check that out. There is the YouTube channel for Floss Weekly if you want to see the video. You can just find us it is FlossWeekly over on YouTube. If you search for that, you might also find the Untitled Linux Show, which is my show over at Twit, which is more Linux and less open source, although, boy, there's a, there's a lot of overflow between those two.

So if you like this, you'll probably like that too, and give that a a check out too. We sure appreciate everybody being here, those that caught us live, those that get us on the download, and we will see you next week on Floss Weekly.

Kategorier
Förekommer på
00:00 -00:00