We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Meyerand

From Esolang
Jump to navigation Jump to search

Meyerand is a Go-based programming language which is also based on Bertrand Meyer's ideas about break and continue keywords and has no explicit return keyword for a similar reason.

Essentially, the idea is for there to be nothing similar to a goto and nothing which can randomly execute code in some weird way unrelated to the linear code.

The language also doesn't have Go's concurrency operations because it sucks in every way other than forcing people to listen to Bertrand Meyer.

Keywords

The language is similar to Go, like how StatiC is similar to C, but it is also fundamentally different from Go in extremely large ways. This is because

This is a table of all the keywords in Meyerand and how they differ from Go keywords when applicable:

Keywords
Keyword Definition Notes
const declares fixed values that cannot change during program execution
else Provides an alternate code path if an if condition evaluates to false
for creates a loop, which is Go's sole looping construct.
func declares a function or method
if evaluates a conditional expression to direct program flow
import brings external or standard library packages into your current file
interface defines a set of method signatures that a type must implement
map defines an unordered collection of key-value pairs
package groups related Go source files together under a shared namespace
range iterates over elements in arrays, slices, strings, or maps
struct groups variables (fields) together into a single custom composite data type
type declares a new custom type or alias
var declares one or more standard variables

The Go keywords which Meyerand doesn't have, in alphabetical order, are:

  • break - self-explanatory
  • case - switch statements are too similar to goto
  • chan - concurrent operation is too nonlinear
  • continue - self-explanatory
  • default - switch statements are too similar to goto
  • defer - this seems too similar to goto
  • fallthrough - switch statements are too similar to goto
  • go - concurrent operation is too nonlinear
  • goto - self-explanatory
  • return - can't have multiple return statements within a function without a return statement at all
  • select - concurrent operation is too nonlinear
  • switch - switch statements are too similar to goto

Numerical Size

Like Go, Meyerand is statically and strongly typed. One major difference between Meyerand and Go is that instead of being able to indicate numerical size by casting, it is indicated by the size of the integers in the function definition as the function definition goes on.

Technically, the integer sizes in Meyerand are:

  • integer: 8-bit, 16-bit, 32-bit, 64-bit, 128-bit, 256-bit; signed and unsigned
  • float: 32-bit, 64-bit, 128-bit, 256-bit

However, in order to create (for example) a signed 16-bit integer with a value of 2, you would have to do something like:

var sixteenInt = -30000 + 30002

A negative number at the beginning ensures the value is signed, but all you need to do to ensure a signed value is to have the sum from left to right be negative at some point.

  • var eightInt = 3 - 2 (unsigned int8)
  • var eightInt = 3 - 4 + 2 (signed int8)
  • var eightInt = 3 + 2 - 4 (unsigned int8)

Anyways...

Literals and Operators

All the literals and operators in this language are the same as in Go and act the same way as in Go and do the same things as in Go. The semicolon insertion rules are the same as in Go. Generally, everything in the "Lexical Elements" part of the Go specification applies to this language except for the parts which explicitly do not.