James Shubin f53376cea1 lang: Add function values and lambdas
This adds a giant missing piece of the language: proper function values!
It is lovely to now understand why early programming language designers
didn't implement these, but a joy to now reap the benefits of them. In
adding these, many other changes had to be made to get them to "fit"
correctly. This improved the code and fixed a number of bugs.
Unfortunately this touched many areas of the code, and since I was
learning how to do all of this for the first time, I've squashed most of
my work into a single commit. Some more information:

* This adds over 70 new tests to verify the new functionality.

* Functions, global variables, and classes can all be implemented
natively in mcl and built into core packages.

* A new compiler step called "Ordering" was added. It is called by the
SetScope step, and determines statement ordering and shadowing
precedence formally. It helped remove at least one bug and provided the
additional analysis required to properly capture variables when
implementing function generators and closures.

* The type unification code was improved to handle the new cases.

* Light copying of Node's allowed our function graphs to be more optimal
and share common vertices and edges. For example, if two different
closures capture a variable $x, they'll both use the same copy when
running the function, since the compiler can prove if they're identical.

* Some areas still need improvements, but this is ready for mainstream
testing and use!
2019-07-17 00:27:09 -04:00
2019-03-24 15:37:54 -04:00
2016-09-18 05:47:33 -04:00
2019-03-24 15:08:50 -04:00
2019-03-24 15:08:50 -04:00
2019-03-24 15:08:50 -04:00
2019-02-06 10:48:24 +01:00
2019-04-16 18:08:39 -04:00
2019-07-17 00:27:09 -04:00
2019-03-24 15:08:50 -04:00
2019-03-24 15:08:50 -04:00
2019-03-24 15:08:50 -04:00
2019-05-05 09:32:04 -04:00
2016-05-21 11:08:14 +02:00
2019-05-05 09:32:04 -04:00
2018-02-23 19:59:55 -05:00
2017-09-11 18:07:47 -04:00
2019-03-24 15:08:50 -04:00
2019-03-24 15:08:50 -04:00
2019-07-17 00:27:09 -04:00
2016-01-04 21:00:13 -05:00
2015-09-25 01:16:03 -04:00
2015-09-25 01:16:03 -04:00
2017-09-11 18:07:47 -04:00
2018-05-19 09:21:06 +02:00

mgmt: next generation config management!

mgmt!

Go Report Card Build Status GoDoc IRC Patreon Liberapay

About:

Mgmt is a real-time automation tool. It is familiar to existing configuration management software, but is drastically more powerful as it can allow you to build real-time, closed-loop feedback systems, in a very safe way, and with a surprisingly small amout of our mcl code. For example, the following code will ensure that your file server is set to read-only when it's friday.

import "datetime"
$is_friday = datetime.weekday(datetime.now()) == "friday"
file "/srv/files/" {
	state => "exists",
	mode => if $is_friday { # this updates the mode, the instant it changes!
		"0550"
	} else {
		"0770"
	},
}

It can run continuously, intermittently, or on-demand, and in the first case, it will guarantee that your system is always in the desired state for that instant! In this mode it can run as a decentralized cluster of agents across your network, each exchanging information with the others in real-time, to respond to your changing needs. For example, if you want to ensure that some resource runs on a maximum of two hosts in your cluster, you can specify that as well:

import "sys"
import "world"

# we'll set a few scheduling options:
$opts = struct{strategy => "rr", max => 2, ttl => 10,}

# schedule in a particular namespace with options:
$set = world.schedule("xsched", $opts)

if sys.hostname() in $set {
	# use your imagination to put something more complex right here...
	print "i got scheduled" {} # this will run on the chosen machines
}

As you add and remove hosts from the cluster, the real-time schedule function will dynamically pick up to two hosts from the available pool. These specific functions aren't intrinsic to the core design, and new ones can be easily added.

Please read on if you'd like to learn more...

Community:

Come join us in the mgmt community!

Medium Link
IRC #mgmtconfig on Freenode
Twitter @mgmtconfig & #mgmtconfig
Mailing list mgmtconfig-list@redhat.com
Patreon purpleidea on Patreon
Liberapay purpleidea on Liberapay

Status:

Mgmt is a next generation automation tool. It has similarities to other tools in the configuration management space, but has a fast, modern, distributed systems approach. The project contains an engine and a language. Please have a look at an introductory video or blog post.

Mgmt is a fairly new project. It is usable today, but not yet feature complete. With your help you'll be able to influence our design and get us to 1.0 sooner! Interested users should read the quick start guide.

Documentation:

Please read, enjoy and help improve our documentation!

Documentation Additional Notes
quick start guide for everyone
frequently asked questions for everyone
general documentation for everyone
language guide for everyone
function guide for mgmt developers
resource guide for mgmt developers
style guide for mgmt developers
godoc API reference for mgmt developers
prometheus guide for everyone
puppet guide for puppet sysadmins
development for mgmt developers

Questions:

Please ask in the community! If you have a well phrased question that might benefit others, consider asking it by sending a patch to the FAQ section. I'll merge your question, and a patch with the answer!

Roadmap:

Feel free to grab one of the straightforward #mgmtlove issues if you're a first time contributor to the project or if you're unsure about what to hack on! Please get involved by working on one of these items or by suggesting something else!

Bugs:

Please set the DEBUG constant in main.go to true, and post the logs when you report the issue. Feel free to read my article on debugging golang programs.

Patches:

We'd love to have your patches! Please send them by email, or as a pull request.

On the web:

Read what people are saying and publishing about mgmt!

Happy hacking!

Description
No description provided
Readme 12 MiB
Languages
Go 95%
Shell 2.3%
Yacc 0.9%
Makefile 0.8%
JavaScript 0.4%
Other 0.6%