Commit Graph

188 Commits

Author SHA1 Message Date
James Shubin
ecee84aa28 docs: New blog post about modules and imports 2024-12-03 03:00:21 -05:00
James Shubin
380004b1dc readme, docs: New docs available 2024-11-23 01:25:40 -05:00
James Shubin
28a443d11d docs: Add a hack for golang functions 2024-11-22 14:20:24 -05:00
James Shubin
a600e11100 cli, docs: Add a docs command for doc generation
This took a lot longer than it looks to get right. It's not perfect, but
it now reliably generates documentation which we can put into gohugo.
2024-11-22 14:20:16 -05:00
James Shubin
8df82f0301 docs: Add a new faq entry about deploy.readfile
This may be a common thing people forget.
2024-09-18 21:38:08 -04:00
James Shubin
29eebd0d07 lang: core: Move template to golang namespace
I don't think this template function should be in any way authoritative,
so let's namespace it.
2024-09-13 15:51:24 -04:00
James Shubin
a0972c0752 lang, engine: Add a metaparam for catching accidental dollar signs
Let's make our life easier for users!
2024-08-22 20:41:48 -04:00
James Shubin
f2d4cac92d docs: Add a short contributing guide
I think this is all common sense, but I thought it might be helpful for
anyone that might not be well-versed with how such projects run.
2024-08-16 23:57:38 -04:00
James Shubin
c5dc9c7650 docs: Add a guide for writing API services
Hopefully this is useful to companies who want to design their services
properly to support modern tooling.
2024-08-16 23:38:27 -04:00
James Shubin
fd86b35ce3 docs: Improve the FAQ 2024-07-23 17:26:57 -04:00
James Shubin
14577a0c46 lang: Add modern type unification implementation
This adds a modern type unification algorithm, which drastically
improves performance, particularly for bigger programs.

This required a change to the AST to add TypeCheck methods (for Stmt)
and Infer/Check methods (for Expr). This also changed how the functions
express their invariants, and as a result this was changed as well.

This greatly improves the way we express these invariants, and as a
result it makes adding new polymorphic functions significantly easier.

This also makes error output for the user a lot better in pretty much
all scenarios.

The one downside of this patch is that a good chunk of it is merged in
this giant single commit since it was hard to do it step-wise. That's
not the end of the world.

This couldn't be done without the guidance of Sam who helped me in
explaining, debugging, and writing all the sneaky algorithmic parts and
much more. Thanks again Sam!

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
2024-07-01 18:33:47 -04:00
xlai89
201cf091d5 test: Add a links checker and fix some links 2024-06-17 14:17:39 -04:00
James Shubin
3b754d5324 docs: Fix markdown failing
It fails locally, but not in CI, and I don't know why.
2024-05-05 15:34:04 -04:00
James Shubin
7a568627e9 docs: Update dead links 2024-05-05 15:34:00 -04:00
James Shubin
328360eea8 docs: Add addition to style guide for pointer receivers 2024-04-28 16:14:05 -04:00
James Shubin
c12452b3ce misc: Move to golang 1.21
Unfortunately, this also breaks go-mod-upgrade with:

upgrade failed error=Error running go command to discover modules: exit
status 1 stderr=go: loading module retractions for
golang.org/x/mod@v0.16.0: version "v0.17.0" invalid: resolves to version
v0.17.1-0.20240315155916-aa51b25a4485 (v0.17.0 is not a tag) go: loading
module retractions for golang.org/x/sync@v0.6.0: version "v0.7.0"
invalid: resolves to version v0.7.1-0.20240304172602-14be23e5b48b
(v0.7.0 is not a tag)
2024-04-25 13:01:41 -04:00
James Shubin
51cf1e2921 lang: ast: The res and edge names should not use exclusives
This removes the exclusive from the res names and edge names. We now
require that the names should be lists of strings, however they can
still be single strings if that can be determined statically.
Programmers should explicitly wrap their variables in a string by
interpolation to force this, or in square brackets to force a list. The
former is generally preferable because it generates a small function
graph since it doesn't need to build a list.
2024-04-18 00:07:53 -04:00
Felix Frank
29ec867ac7 gapi: Bring back puppet and langpuppet
This reverts commit e767655ede.

In addition, it applies required changes to function with the new CLI backend.
2024-04-02 21:07:02 -04:00
Julian Rüth
22873b3c3f docs: Fix docker build instructions
fixes #752
2024-04-03 01:01:47 +03:00
Julian Rüth
ede5db18d7 docs: Binaries are not outdated currently 2024-04-03 01:01:37 +03:00
James Shubin
964b1dc58a docs: Add release notes for 0.0.26
I send these out by email and then archive a copy here. Sign up to the
mgmt partner program for early access. Ping me for details.
2024-03-30 19:03:31 -04:00
James Shubin
a1db219fd2 docs: Add release notes for 0.0.25
I send these out by email and then archive a copy here. Sign up to the
mgmt partner program for early access. Ping me for details.
2024-03-27 17:21:08 -04:00
James Shubin
46b2fe0eba docs: Add old release notes
These release notes used to live on the mailing list at:
https://listman.redhat.com/archives/mgmtconfig-list/ until Red Hat
killed off this excellent service recently.

I'm adding them all here for reference.

Before 0.0.9 there were no release notes.
2024-03-26 14:38:26 -04:00
James Shubin
589a5f9aeb cli, lib, lang: Port to new cli library
The new version of the urfave/cli library is moving to generics, and
it's completely unclear to me why this is an improvement. Their new API
is very complicated to understand, which for me, defeats the purpose of
golang.

In parallel, I needed to do some upcoming cli API refactoring, so this
was a good time to look into new libraries. After a review of the
landscape, I found the alexflint/go-arg library which has a delightfully
elegant API. It does have a few rough edges, but it's otherwise very
usable, and I think it would be straightforward to add features and fix
issues.

Thanks Alex!
2024-03-01 21:02:55 -05:00
James Shubin
e767655ede cli, puppet, langpuppet: Remove puppet GAPI's
I'm currently refactoring the CLI code. Unfortunately this means a
pretty big churn in the various GAPI frontends. Since nobody is actively
using the puppet frontend code, I'm removing it for now. If someone is
actively using it, and wants to either port it to the new API, or
sponsor the porting of it to the new API, I'm happy to allow it back in.

Sorry Felix, it was a fun idea, and I loved seeing it work, but I can't
personally afford the maintenance cost of having this in right now.
2024-03-01 21:02:55 -05:00
James Shubin
d6cf595899 lang: Unnested the core package from the functions dir
The core package could contain non-functions, so we might as well move
it upwards.
2024-02-22 17:19:02 -05:00
James Shubin
57910470a9 docs: Add new talks from Belgium 2024 2024-02-09 10:49:35 -05:00
James Shubin
890b6e9a28 docs: Add empty list declarations to style guide
This seems to have come up lately, so add my reasoning. Debate is
welcome-- to a point.
2024-02-09 04:48:16 -05:00
James Shubin
edf47a1737 lang: gapi, docs: Add a --skip-unify option to speed up run
This is useful for run and dangerous for deploy. If we make type
unification blazing fast, we should probably get rid of this option.
2024-02-08 10:49:22 -05:00
James Shubin
32916f9a6f engine: resources: Receive keys should match mcl, not golang
The capitalization of these keys was wrong and they weren't getting
seen. Add a test as well.
2024-01-22 19:40:15 -05:00
James Shubin
a8f194259b legal: Happy 2024 everyone...
Done with:

ack '2023+' -l | xargs sed -i -e 's/2023+/2024+/g'

Checked manually with:

git add -p

Hello to future James from 2025, and Happy Hacking!
2024-01-22 15:52:49 -05:00
James Shubin
aae0e16350 lang: ast, parser, interfaces: Implementation of nested class sugar
This implements a new type of syntactic sugar for the common pattern of
a base class which returns a child class, and so on. Instead of needing
to repeatedly indent the child classes, we can instead prefix them at
the definition site (where created with the class keyword) with the name
of the parent class, followed by a colon, to get the desired embedded
sugar.

For example, instead of writing:

class base() {
	class inner() {
		class deepest() {
		}
	}
}

You can instead write:

class base() {
}
class base:inner() {
}
class base:inner:deepest() {
}

Of course, you can only access any of the inner classes by first
including (with the include keyword) a parent class, and then
subsequently including the inner one.
2024-01-14 17:10:31 -05:00
James Shubin
44ee578a3a lang: parser, ast, interfaces: Implement include as
This adds support for `include as <identifier>` type statements which in
addition to pulling in any defined resources, it also makes the contents
of the scope of the class available to the scope of the include
statement, but prefixed by the identifier specified.

This makes passing data between scopes much more powerful, and it also
allows classes to return useful classes for subsequent use.

This also improves the SetScope procedure and adds to the Ordering
stage. It's unclear if the current Ordering stage can handle all code,
or if there exist corner-cases which are valid code, but which would
produce a wrong or imprecise topological sort.

Some extraneous scoping bugs still exist, which expose certain variables
that we should not depend on in future code.

Co-authored-by: Samuel Gélineau <gelisam@gmail.com>
2024-01-14 17:08:51 -05:00
James Shubin
24054f905f lib, lang, docs: Add --only-unify option
This adds a new run flag for the lang frontend to exit immediately
following type unification. This makes it easier to use this as a step
in CI, and also to type the execution for performance comparison
reasons.
2024-01-02 13:06:19 -05:00
James Shubin
32ca815896 lib, docs: Small cleanups
Formatting and removing of old docs.
2024-01-02 13:04:49 -05:00
James Shubin
a6b6aa570e test: Fix small test warnings
These were issues we should be catching.
2023-12-12 00:01:29 -05:00
James Shubin
bf5cc63bc5 misc: Move to golang 1.20
Make sure to quote your 1.20 otherwise it shows up as 1.2 which is very
old!
2023-12-03 21:40:48 -05:00
James Shubin
139fed40dd docs: Add a reminder about a common gotcha
When I hit it the second time, I decided it needed to get added here.
2023-11-27 19:57:54 -05:00
James Shubin
53f9f35233 docs: Misc fixes 2023-09-25 18:53:54 -04:00
James Shubin
7ccda7e99b engine: Add a ctx to the CheckApply API
This is just a rough port, there are lots of optimizations to be done
and lots of timeout values that should be replaced by a new timeout meta
param!
2023-09-02 01:34:42 -04:00
James Shubin
b134c4b778 lang: interfaces, funcs: Port Func API to new Stream signature
This removes the `Close() error` and replaces it with a more modern
Stream API that takes a context. This removes boilerplate and makes
integration with concurrent code easier. The only downside is that there
isn't an explicit cleanup step, but only one function was even using
that and it was possible to switch it to a defer in Stream.

This also renames the functions from polyfunc to just func which we
determine by API not naming.
2023-08-08 21:33:06 -04:00
James Shubin
514927c0b3 engine: resources, graph: Change the Close method to Cleanup
This also changes a few similarly named methods. Clearer what it's doing
in terms of cleanup vs. causing some action.
2023-08-08 01:11:29 -04:00
James Shubin
963393e3d9 engine: graph, resources: Change Watch to use ctx
This is a general port. There are many optimizations and cleanups we can
do now that we have a proper context passed in. That's for a future
patch.
2023-08-08 01:11:29 -04:00
James Shubin
90e8e02b0c misc: Move to new golang version 2023-08-07 23:52:37 -04:00
Laurent Indermuehle
0dcfe027b0 make: Add a Dockerfile to build mgmt for Fedora 2023-07-11 14:26:02 +02:00
James Shubin
3f5957d30e docs: readme: Add new talk and clarify README
This should make it more obvious how to reach this content as it might
not have been particularly clear to new users where to find this
information.
2023-04-07 11:51:43 -04:00
James Shubin
a7624a2bf9 legal: Happy 2023 everyone...
Done with:

ack '2022+' -l | xargs sed -i -e 's/2022+/2023+/g'

Checked manually with:

git add -p

Hello to future James from 2024, and Happy Hacking!
2023-03-05 18:31:52 -05:00
James Shubin
aff6331211 misc, docs: Move to golang 1.18
Hopefully this fixes some yucky things.
2022-09-11 20:55:37 -04:00
James Shubin
d547c39a16 misc, docs: Move to golang 1.17
There are a few small source fixes and other tidbits to move past 1.16,
but we can do those later.
2022-08-16 19:30:20 -04:00
James Shubin
3cea422365 legal: Happy 2022 everyone...
Done with:

ack '2021+' -l | xargs sed -i -e 's/2021+/2022+/g'

Checked manually with:

git add -p

Hello to future James from 2023, and Happy Hacking!
2022-08-05 23:06:27 -04:00