Thank you for posting this. > let {print} = import "std.io" An idea obvious in hindsight that I hadn't thought before - if import returns an environment and let can destructure, then a pattern match can bind an explicit subset of that import. Something like: `(let {print read} (import io) (print (read)))` Further down I find essentially that example (with input instead of read) and destructuring assignment within fun…
Bog – small, strongly typed, embeddable language
41–50 of 55 posts
Re: Bog – small, strongly typed, embeddable language
#42Earlier quoted context omitted.
I read that as "Yes, Bog does formatted strings", and appreciate the density.
The purpose of a Hello World, however, is not to showcase language features, it’s to provide a minimal program that produces output, to test that your dev environment is working properly, and for you to learn how to operate it. Adding any unnecessary complications to it only adds further sources of error.
Or do you think most people will automatically adjust and think "hello world in itself doesn't show much, so the author decided to include something more informative and keep call that hello world" ?
Re: Bog – small, strongly typed, embeddable language
#43Earlier quoted context omitted.
The purpose of a Hello World, however, is not to showcase language features, it’s to provide a minimal program that produces output, to test that your dev environment is working properly, and for you to learn how to operate it. Adding any unnecessary complications to it only adds further sources of error.
Do you think real people will get confused and think the only way to write hello world in bog is using a variable ? Or do you think most people will automatically adjust and think "hello world in itself doesn't show much, so the author decided to include something more informative and keep call that hello world" ?
Re: Bog – small, strongly typed, embeddable language
#44Earlier quoted context omitted.
Something I hate about about c is that you don't know where the hell somefunc() came from. Some languages have foo.somefunc() which I think works quite well although iffooisrealllylong.function() is a risk. I suppose this gets you the best of both worlds. Although using let does seem a bit weird to me. It seems conceptually misleading.
> Something I hate about about c is that you don't know where the hell somefunc() came from. I think you mean something you hate about not using an IDE with the language. One can do `from onoz import *` in python and Java to have a similar "wait, where did do_magic() come from?" experience, and then Scala will see your wildcard import and raise you implicit methods , which can die in a raging fire tornado
Well it's a 'feature' of the language so the criticism still stands. Ides could solve a lot of language warts but we still rightfully criticise the language for the warts. C's lack of memory safety could be solved by good programming practices, but we still criticise c for the lack of memory safety.
Re: Bog – small, strongly typed, embeddable language
#45Aside from my biased nitpick, it looks pretty neat!
Re: Bog – small, strongly typed, embeddable language
#46Re: Bog – small, strongly typed, embeddable language
#47Pretty interesting. I'm a professional user of Lua, and while I love it, I really get frustrated at a lot of aspects of it, especially how loose the typing is. I've long wished there were more strongly typed alternatives, but just nothing compares to the performance, stability, and quality of documentation of Lua. I'm not sure how I would embed this in a non-Zig project, though.
Have you heard of Teal ( https://github.com/teal-language/tl )? It's like typescript for Lua made by Hisham. It also has the concept of declaration files so you can import (and type) existing Lua modules if needed.
Edit: Oh yes it's still like that 'When loading and running the Teal module from Lua, there is no type checking! Type checking will only happen when you run tl check or load a program with tl run.' from https://github.com/teal-language/tl/blob/master/docs/tutoria...
Re: Bog – small, strongly typed, embeddable language
#48Pretty interesting. I'm a professional user of Lua, and while I love it, I really get frustrated at a lot of aspects of it, especially how loose the typing is. I've long wished there were more strongly typed alternatives, but just nothing compares to the performance, stability, and quality of documentation of Lua. I'm not sure how I would embed this in a non-Zig project, though.
See also this list for comparison https://github.com/fubark/cyber/issues/6, if you dont want lua by a meta-compiler.
If you want non-allocating scripting for optimal performance (and io limited to what you provide as buffer), go for https://dascript.org/. I dont think there are currently other projects with that performance (+ also inspired by Zig). Though, not sure how clunky it is to use.
Re: Bog – small, strongly typed, embeddable language
#49Love how this language is explained with code only.
Sample code is great, but I'd be happier with a README that says something about the language (and, to a lesser extent, about its implementation).
Apparently Bog is based on Zig, but I didn't learn that until after reading about 80% of the README -- and since I'm not particularly familiar with Zig, I don't quite know what to do with that information.
Probably the author had a narrower audience in mind when writing the README.