Live data from Hacker News

Buzz: A lightweight statically typed scripting language

buzz-lang.dev

81–90 of 91 posts

Re: Buzz: A lightweight statically typed scripting language

#81
post #33

Earlier quoted context omitted.

I don't know about Nim, but Go does not feel like scripting. It feels like C-style programming. Really old school and not good for scripting at all.

Completely agree... but when people like a language, they may still want to write scripts in it even though it may be really uncomfortable. That said, Nim is actually designed to feel like a scripting language... for example, you don't write a main function at all, just code away (this is an actual hello world program in Nim): echo "hello world" So, out of statically typed languages, Nim is probably one of the best c…

interesting. has chatgpt/copilot been trained on nim to the point where they creates code as good they do with python?

I ask because I've always treated coding as a necessary evil. When I worked as a programmer, I never gave 2 shits about the language I was required to use. I'd write a specification, code to the specification and tried to update the spec if I need to deviate from it.

Because of my damaged hands, now, I do not have enough typing capacity to learn a new language the old trial and error way. chatgpt is my accessibility tool for creating code.

I've learned how to give chatgpt a spec, skip the coding step and goto validation. I've trained myself and chatgpt/copilot to generate python code like I had created it, making desk and unit testing easier and faster.

Learning a new language would start with a specification of the problem as above, then seeing what chatgpt/copilot generates. However, it is easier to learn if the LLM model understands the language. It is sometimes hard to tell the difference between hallucinations in the code vrs hallucination in the specification.

Re: Buzz: A lightweight statically typed scripting language

#82

We don’t need any more computer languages. Still, you will run right off and invent another one. Let me guess, your amazing new language uses IEEE-754 math and fixed-precision integers. Your amazing new language is broken. https://www.quora.com/What-are-some-things-that-only-someone...

A language without easy access to IEEE-754 math and fixed-precision integers that is supposed to run on common/standard hardware (i.e. not for FPGAs or more specialist hardware) is broken for the majority of the tasks it will be doing. That's not preventing you from having other numerical types which meet the needs of various groups (e.g. arbitrary precision types or types for financial maths), but to explicitly exclude them even though the hardware provides them is a problem.

Re: Buzz: A lightweight statically typed scripting language

#83
post #68

Earlier quoted context omitted.

Why do you say it's not a scripting language? You can write .fsx files and run them as scripts, and there's a nice REPL. Using Polyglot Notebooks, you can even combine several languages, including F# and PowerShell, and documentation and run the notebooks as scripts. Were you running F# with modern .NET, i.e., .NET5+?

F# is a compiled language

Why does that matter, exactly? What affect on scripting does that have?

You can run a script file via `dotnet fsi script.fsx`. You can load and run a script inside FSI (F# interactive, the F# REPL) via `#load script.fsx`. You can run a notebook as a script via `dotnet repl --run notebook.dib --exit-after-run`. There is no "compilation" visible or required by the user.

This is nearly identical, except that it's improved and more featureful, to how one runs a script in Python. Whether F# is compiled or not is immaterial.

Re: Buzz: A lightweight statically typed scripting language

#84

Earlier quoted context omitted.

There are no such things as “serving spoons” — any spoon is a serving spoon if you serve something with it. There are no such things as “desert spoons” — any spoon is a desert spoon if you eat desert with it. Don’t get me started on whether or not teaspoons exist. This is such a pointless observation given the world has really come down heavily on the side of sanity, which is to say yes clearly any language can be us…

It seems like the term "scripting language" has become a pejorative; denigrating a programming language as somehow less worthy for "serious" programs than non-scripting languages. To me, when I hear someone describe a language as a scripting language, it says more about how they think about programming than the functionality and applicability of a language for solving different classes of problems. I'm coming to thin…

100% agree. And just like you don’t talk to a new-born child in quantifier logic and you don’t attempt to write a PhD thesis in babytalk, there are places where more or less rigorous and exacting language is appropriate.

It used to be the general consensus was that “scripting” comprised quick and temporary automation of tasks and therefore the emphasis in a language was on something convenient and expressive that could get a bunch of stuff done quickly even if the semantics were a bit janky (I’m looking at you bourne shell). Then perl really opened a lot of people’s eyes to what could be done with “scripting languages” (both in terms of power and in terms of the horror that could unleash in the wrong hands) and there has since been a gradual shift towards simplicity and understandability given that there are few things more permanent than a temporary script.

Re: Buzz: A lightweight statically typed scripting language

#85

We don’t need any more computer languages. Still, you will run right off and invent another one. Let me guess, your amazing new language uses IEEE-754 math and fixed-precision integers. Your amazing new language is broken. https://www.quora.com/What-are-some-things-that-only-someone...

A language without easy access to IEEE-754 math and fixed-precision integers that is supposed to run on common/standard hardware (i.e. not for FPGAs or more specialist hardware) is broken for the majority of the tasks it will be doing. That's not preventing you from having other numerical types which meet the needs of various groups (e.g. arbitrary precision types or types for financial maths), but to explicitly excl…

Classic premature optimization, assuming that hardware functions must be revealed in language features. If you can't get your integers closed under addition from the get-go, what hope do you have of writing a secure programming language?

Re: Buzz: A lightweight statically typed scripting language

#86
post #33

Earlier quoted context omitted.

Completely agree... but when people like a language, they may still want to write scripts in it even though it may be really uncomfortable. That said, Nim is actually designed to feel like a scripting language... for example, you don't write a main function at all, just code away (this is an actual hello world program in Nim): echo "hello world" So, out of statically typed languages, Nim is probably one of the best c…

interesting. has chatgpt/copilot been trained on nim to the point where they creates code as good they do with python? I ask because I've always treated coding as a necessary evil. When I worked as a programmer, I never gave 2 shits about the language I was required to use. I'd write a specification, code to the specification and tried to update the spec if I need to deviate from it. Because of my damaged hands, now,…

It ultimately depends upon what you mean by "as good". There is no clear single metric. Once you have >1 metric it becomes a subjective "who's priorities?" game of weighting them / projecting them into a single metric.

The best answer to a question like yours is: give it a try on some easy problems and see what you think yourself. No one else can really know the kinds of problems / answers / code you most work with (and sometimes the future is pretty murky even to oneself, even in these vague categories).

Disclaimers issued, some things can be said which might help. Since Nim is primarily a highly ergonomic static ahead-of-time compiled language with code running as fast as C often does, errors may be caught more conveniently. Because Python is popular, especially for teaching programming, training coverage will always be better, but Nim has some core features & keywords "kinda similar" to Python which may help on the other side.

Not sure about 4.0, but ChatGPT-3.5 does poorly on basic Nim things without Python equivalents. To give just one concrete example (out of many), `a,b = b,a` is a common way to manifest swapping in Python while in Nim one uses `swap a,b`.

So, if you are willing to do more "compiler-assisted clean-up" or have a/develop a knack at steering the random sampling toward code which compiles, Nim could be about as effective as Python used this way.

In terms of code entry work for your specific hands problem, parentheses can often be left off in Nim code and in general it seems to have much less punctuation / syntactic noise. Of course, keys can be rebound & such & maybe you do that, too. Nim definitely has more powerful abstraction mechanisms like user-defined operators, templates, and syntax macros.

Re: Buzz: A lightweight statically typed scripting language

#87

Earlier quoted context omitted.

It seems like the term "scripting language" has become a pejorative; denigrating a programming language as somehow less worthy for "serious" programs than non-scripting languages. To me, when I hear someone describe a language as a scripting language, it says more about how they think about programming than the functionality and applicability of a language for solving different classes of problems. I'm coming to thin…

100% agree. And just like you don’t talk to a new-born child in quantifier logic and you don’t attempt to write a PhD thesis in babytalk, there are places where more or less rigorous and exacting language is appropriate. It used to be the general consensus was that “scripting” comprised quick and temporary automation of tasks and therefore the emphasis in a language was on something convenient and expressive that cou…

[deleted]

Re: Buzz: A lightweight statically typed scripting language

#88
post #86

Earlier quoted context omitted.

interesting. has chatgpt/copilot been trained on nim to the point where they creates code as good they do with python? I ask because I've always treated coding as a necessary evil. When I worked as a programmer, I never gave 2 shits about the language I was required to use. I'd write a specification, code to the specification and tried to update the spec if I need to deviate from it. Because of my damaged hands, now,…

It ultimately depends upon what you mean by "as good". There is no clear single metric. Once you have >1 metric it becomes a subjective "who's priorities?" game of weighting them / projecting them into a single metric. The best answer to a question like yours is: give it a try on some easy problems and see what you think yourself. No one else can really know the kinds of problems / answers / code you most work with (…

Your suggestion at the end is a form of "speaking the keyboard" problem that has plagued speech-driven programming for years. It is so wonderful that I can dictate the specs and then verbally cut and paste them into the LLM. If I had the energy, I would build an LLM interface that used speech recognition-friendly text areas that one could use speech for editing and revising results.[1]

Your response, however, touches on the meta-problem of adding additional information to a training set. For example, as people learn and generate more nim code, the community can expand the LLM capabilities without going through open AI or whoever. I know training requires a lot of GPU time, so training over distributed GPUs is necessary. For example, I would buy one or two GPUs and pay for the electricity to contribute to community LLM training efforts.

[1] For anyone interested in helping, it would be a simple two-panel design: top for editing, lower for LLM results, and two buttons, first for "copy to clipboard," second for "submit to LLM."

Re: Buzz: A lightweight statically typed scripting language

#89

Earlier quoted context omitted.

For me it's when it's useful for writing adhoc utility tools distributed as source, and directly runnable from source code in the terminal and without requiring a manual compilation step (but maybe requiring installing a runtime). E.g. Python, JS/TS with node.js/deno, Lua, Bash, Powershell qualify as scripting language, but C, C++, Rust are not. Of course there's a grey area of compilers which allow compiling and run…

Sorry, but I strongly disagree with your explanation. It seems to categorize languages on the basis of what tools are available or widely used. That's not a property of languages. A language can be designed once and then interpreters and compilers (and transpilers) can be made available for it. Python is a classic example: it's most commonly interpreted, but can be compiled when performance matters. C is usually comp…

> A language can be designed once and then interpreters and compilers (and transpilers) can be made available for it.

While strictly true, some language features are awkward or unsuitable for scripting purposes. For instance, C++ templates and Haskell's type classes with extensions that make overload resolution Turing complete. You can do this, but it seems like a poor choice where the language ostensibly has runtime evaluation and type information available, and so you don't need to so strictly stratify the types and values. This collapses effectively two programming language levels into one, and considerably simplifies quite a bit of the runtime, compiler/interpreter, and the programs that can be expressed in the language

Re: Buzz: A lightweight statically typed scripting language

#90
post #3

What should I be looking for here that distinguishes it from other lightweight statically-typed scripting languages? Performance? Tooling? Particularly good FFI? There are some syntactic quirks that don't convey any obvious benefit, like the use of '>' to indicate a return type. Since this language uses C-style prefixed type identifiers, why not do that for functions as well? Alternately, why not use the much more co…

> Comments starting with '|' feels like pure quirk.

Yeah... | is a pipe (shell) or an "or" (programming) symbol. Seeing it in the code to indicate a comment just rubs me the wrong way. It's almost as if it was chosen just to be different.

Post reply on HN