Summarized using AI

Going Postel

Scott Werner • November 15, 2024 • Chicago, IL • Talk

In the presentation "Going Postel" at RubyConf 2024, Scott Werner discusses Postel's Law, an important principle for programming and networked applications that encourages developers to be liberal in what they accept and conservative in what they send. This talk explores how this principle can be applied to generative AI, particularly with Ruby as a programming language.

Key Points:

- Underrepresentation of Ruby in AI: Werner points out that Ruby has not fully participated in the generative AI conversation but emphasizes the language's flexibility and adaptability, likening it to a "sleeping giant" waiting to be utilized.

- Postel's Law Overview: The principle suggests conforming to specifications when sending data (conservative) and accepting variations when receiving (liberal). This approach enables the development of more robust applications.

- Practical Application: Werner demonstrates using Ruby's dynamic features, such as duck typing and metaprogramming, to embrace the non-deterministic nature of large language models (LLMs).

- Live Coding Demonstration: The talk features live coding to generate slides using PowerPoint Co-Pilot, showcasing how a conservative approach shapes code generation while still allowing flexibility from LLMs.

- Projects and Tools:

- Blueprints: This tool allows developers to capture patterns from their code to aid in generating new code. It facilitates pattern recognition and generation based on existing code structures.

- Agent Framework: This framework introduces a Domain-Specific Language (DSL) for defining agents that can respond to changes and efficiently run tests, integrating with LLMs for automated code generation aligned with specified test outcomes.

- Empowering Developers: The flexibility of Ruby permits developers to embrace these new AI tools in a way that enhances productivity and creativity, all while maintaining a conservative testing approach to ensure code quality.

- Invitation to Experiment: The speaker encourages audience members to explore the possibilities that arise from blending generative AI capabilities with Ruby, urging collaboration and experimentation within the community.

Conclusions: Werner concludes that embracing Postel's Law in programming—especially with Ruby and AI—can unlock new methodologies for software development, reiterating the importance of being progressive in accepting inputs while rigorously testing the outputs. This sentiment encapsulates the notion that the evolving landscape of programming with LLMs presents exciting opportunities for innovation and growth in the Ruby community.

Going Postel
Scott Werner • November 15, 2024 • Chicago, IL • Talk

Postel’s Law states that we should be liberal in what we accept and
conservative in what we send. When working with code generated from LLMs, embracing
this principle is even more important. This talk explores and demonstrates live
the ways that Ruby’s flexibility makes this possible, why I think Ruby is a sleeping
giant in the future of LLM-generated code, and the key to unlocking generative
AI’s true power for software development.

RubyConf 2024

00:00:16.320 okay so I don't think it's controversial
00:00:19.600 to say that Ruby hasn't really been in
00:00:21.920 the generative AI
00:00:23.560 conversation we haven't um but I think
00:00:26.720 that's a real shame and it's a real
00:00:28.439 shame not because
00:00:30.519 you know we're not getting official sdks
00:00:32.439 from all the providers we can write our
00:00:34.280 own sdks we've been doing that for years
00:00:37.239 it's a shame because the Ruby mindset
00:00:41.000 and the Ruby approach to programming
00:00:42.960 isn't being represented in the
00:00:44.920 experiments people are doing as we're
00:00:46.480 trying to figure out how how to actually
00:00:49.879 interact with these this new technology
00:00:53.120 what new applications are we going to be
00:00:54.520 able to build how is it going to change
00:00:56.600 how we build applications
00:01:00.680 and like to me I'm worried that we're
00:01:04.839 going to end up back in the Dark Ages
00:01:06.720 doing whatever we were doing before
00:01:08.759 rails and I don't want that to
00:01:13.400 happen so my name is Scott and this is
00:01:15.720 my talk going
00:01:17.159 postel so I mentioned experimenting and
00:01:20.759 one of the techniques I found that's
00:01:23.040 really helpful when um when
00:01:25.680 experimenting with something new is to
00:01:27.840 take a principle you know very well
00:01:30.560 and apply it to the new domain and
00:01:33.439 really push on it take it to the
00:01:34.680 extremes try it and look at everything
00:01:37.399 through that lens and so we're going to
00:01:40.079 do that today with postell's law which
00:01:42.000 says that you should be liberal in what
00:01:43.280 you accept and conservative in what you
00:01:50.119 send and so as I
00:01:54.200 Was preparing for this presentation I
00:01:57.439 realized another way to really live
00:02:00.799 uh live that principle uh would be to
00:02:03.960 generate my slides live for my talk
00:02:06.960 using PowerPoint
00:02:08.440 co-pilot
00:02:10.319 um let alone how terrifying this is
00:02:12.680 going to be so bear with me here um and
00:02:15.319 so I'm going to ask all of you to also
00:02:16.959 be very liberal in what you accept here
00:02:18.599 from this
00:02:19.840 talk and I will promise to be very
00:02:22.080 conservative in what I send to the llm
00:02:23.800 to to try to make this
00:02:27.959 work um so let's get going
00:02:38.319 see go looking things
00:02:40.800 over almost
00:02:44.319 there
00:02:46.000 and there we go okay so it's gonna
00:02:52.040 work um so like I said postell's law you
00:02:54.760 know is summarized as be uh liberal in
00:02:57.480 what you accept and conservative in what
00:02:58.920 you send and this was a principle coined
00:03:01.040 by John Postell in the early days of the
00:03:03.560 internet early days of networking as
00:03:05.760 everybody was trying to figure out what
00:03:08.120 how to actually build networked
00:03:09.440 applications they didn't know all the
00:03:10.640 things we know today um and so you know
00:03:14.640 this this principle was important for
00:03:17.000 you know starting to build more robust
00:03:19.280 applications build uh build more robust
00:03:21.920 applications that are networked um and
00:03:24.280 you can also think about it like it's
00:03:26.239 also also known as the robustness
00:03:27.959 principle um but you can you know the
00:03:30.599 details of it were basically that if
00:03:32.000 you're going to write a program to send
00:03:34.319 messages out on the network you should
00:03:37.120 do everything in your power to conform
00:03:38.879 to the spec but if you're writing
00:03:41.080 applications that are going to receive
00:03:43.000 messages on the network and you get a
00:03:45.439 message that doesn't exactly conform to
00:03:47.080 the spec but you can determine the
00:03:49.519 intent um just let it through just do do
00:03:52.439 what that person was trying to do uh
00:03:54.159 because none of us know how to build
00:03:55.319 networked applications this is all this
00:03:57.480 is all new so like take it easy um and I
00:04:01.239 think this is a very important principle
00:04:03.000 for llms but it's also something that us
00:04:06.079 as rubius know very
00:04:13.439 well it's something us as rubyist know
00:04:16.280 very well because there are a lot of
00:04:17.959 features and features of Ruby and the
00:04:20.600 culture of Ruby that if you look at it a
00:04:23.040 certain way um you can look you can see
00:04:26.360 it as being uh inspired by postell's law
00:04:29.479 so so so things like Duck typing where
00:04:32.919 um the types don't actually matter as
00:04:35.199 long as the thing that it has responds
00:04:39.000 to the messages you send it Ruby's fine
00:04:42.840 uh Ruby is very liberal in the types
00:04:44.560 that you send it as long as you you know
00:04:47.280 as long as it responds to those messages
00:04:49.960 um a lot of us here are probably
00:04:51.360 familiar with hash within different
00:04:52.880 access which is another example of of
00:04:55.280 building tools in Ruby that are that are
00:04:59.400 post Delan right that this hash within
00:05:02.160 different access lets you uh access hash
00:05:04.639 keys or hash values using string keys or
00:05:07.520 symbol Keys um so to me that strikes me
00:05:10.479 as a very liberal hash implementation
00:05:12.600 it's at least twice as liberal as most
00:05:14.720 other hash implementations I know of um
00:05:18.080 and then finally like Ruby's focus on
00:05:20.840 programmer happiness um and how that's
00:05:23.680 implemented so when I was first learning
00:05:25.840 Ruby a lot of the advice that you would
00:05:27.600 get was um don't even bother looking at
00:05:30.560 the API docs just call a method and a
00:05:33.360 lot of times that method will exist um
00:05:36.680 and that was that's accomplished because
00:05:39.600 a lot of libraries and even Ruby core
00:05:42.319 libraries have multiple different ways
00:05:43.960 to do things and so to me that strikes
00:05:46.479 me as Ruby the language is very liberal
00:05:48.880 in the way that you want to build the
00:05:50.240 program and it's conservative in that it
00:05:52.360 does what you want it to do
00:06:01.600 and so like I said this is a very
00:06:03.560 important principle when working with
00:06:04.720 llms because these things are
00:06:07.199 non-deterministic that they
00:06:10.080 hallucinate
00:06:13.520 and and so there's a lot of work going
00:06:15.919 on in the industry right now to try to
00:06:17.840 constrain the output of these things and
00:06:20.759 make sure that the output from the llm
00:06:25.039 is exactly right but that strikes me as
00:06:27.800 a very conservative in what you accept
00:06:29.960 kind of approach and I think there's an
00:06:32.080 opportunity to take the the Ruby
00:06:34.680 philosophy and the Ruby mindset the
00:06:36.000 thing that we know very well and turn
00:06:37.960 that on its head to so instead of
00:06:41.039 instead of making the making sure the
00:06:44.120 output of the llm is exactly what you
00:06:45.919 want we can build our programs so that
00:06:48.800 whatever the llms give us works so the
00:06:52.759 more a little more liberal uh liberal in
00:06:55.960 what you accept kind of
00:06:58.520 approach and Ruby has a lot of
00:07:02.160 facilities to build programs that way
00:07:05.400 all of us are familiar with um you know
00:07:08.800 metaprogramming uh Dynamic
00:07:11.000 dispatch uh you know extremely by
00:07:16.240 virus like I said liberal in what you
00:07:18.400 accept
00:07:20.039 here um you know dynamic dispatch uh
00:07:23.639 reflection all these things all these
00:07:25.560 tools and Ruby's flexibility allows us
00:07:28.000 to build our programs in a new way using
00:07:30.960 this alien virus technology that um you
00:07:35.560 know that is non-deterministic and we
00:07:37.280 haven't really had technology that um
00:07:41.039 you know lies to us
00:07:44.120 before um so with all of that buildup uh
00:07:47.560 enough talking I'm going to show some
00:07:49.479 code examples of how I've taken um
00:07:52.800 postell's law and really pushed on it
00:07:54.960 and and come up with some uh you know
00:07:57.840 really weird ideas and fun ideas is and
00:08:00.440 um how Ruby has made that uh
00:08:03.680 easy
00:08:06.319 and yes what I'm kind of saying is
00:08:16.919 this so let's get going so one of the
00:08:19.800 first um one of the open source projects
00:08:22.879 that we built is this uh tool called
00:08:24.840 blueprints which is a rail server and um
00:08:29.039 an editor plugins where you can capture
00:08:31.159 patterns in your code and use those as a
00:08:34.479 basis for Generation Um if any of you
00:08:36.959 familiar with with some more of the
00:08:38.440 terms around llms this is essentially
00:08:40.880 like combining uh it's Rag and fuse shot
00:08:43.959 prompting but uh in your editor and a
00:08:47.320 much more simplified version of that um
00:08:51.360 so what it allows you to do is um like I
00:08:54.440 said capture patterns in your code and
00:08:56.160 so here is an example of you know you
00:08:58.160 might have uh an index index view a flex
00:09:00.279 index view for your customer resource
00:09:03.480 it's got you know a section uh it's got
00:09:06.279 a handful of Tailwind class it's got an
00:09:07.720 aside it's got a customer view component
00:09:09.880 and a customer list component and what
00:09:12.480 you're able to do
00:09:16.760 is um you highlight the code you capture
00:09:19.839 the pattern it gets sent to the rail
00:09:21.680 server a description is generated uh we
00:09:24.880 generate vector embeddings and um and
00:09:28.200 and make it available for you to use
00:09:30.200 later and so this is you know baby steps
00:09:33.839 into being conservative in what you send
00:09:36.000 this is a pattern you you know you want
00:09:37.560 to reuse in your code base and so say
00:09:40.680 tomorrow it's like okay we need to
00:09:42.399 create a an index view for our products
00:09:45.519 resource so we can go here you have a
00:09:48.399 description it might come might be
00:09:50.320 something you type out it might be some
00:09:52.279 might be a line in your product
00:09:53.839 management tool um but what you can do
00:09:56.920 is if you take this and you highlight it
00:10:00.040 it gets sent to that rail server it
00:10:02.399 finds the closest match and essentially
00:10:05.320 builds a prompt that says here is a you
00:10:08.079 know here's a customer index view here's
00:10:10.079 what it looks like take that customer
00:10:12.040 index View and create a variation of
00:10:13.680 that for my product and so by being
00:10:16.440 conservative we were able to generate an
00:10:18.360 entire chunk a pattern of our code
00:10:20.640 rather than autocomplete a
00:10:22.880 line and then not only that this code
00:10:25.920 doesn't run because it hallucinated the
00:10:28.760 existence of this product View and
00:10:30.279 product list and so to me that that read
00:10:34.399 or that made me realize that by being
00:10:37.120 conservative in what you send you can
00:10:38.800 actually Target
00:10:40.320 hallucinations to do something that you
00:10:42.839 were probably going to do anyway the
00:10:44.880 product view product list components
00:10:46.320 don't exist but you might have
00:10:48.560 blueprints of the customer View and
00:10:51.120 customer list to go and keep doing that
00:10:54.000 uh layer by
00:10:56.160 layer um but we can take this further
00:10:58.839 right this is just you know being
00:11:01.079 lightly
00:11:02.079 conservative
00:11:03.680 um a more conservative approach is
00:11:06.880 testing and
00:11:09.519 tests you know I I see tests as as you
00:11:12.720 know a much more conservative approach
00:11:14.880 because these things will either run or
00:11:16.720 they won't or here here's the
00:11:18.880 specification of what we want this code
00:11:20.160 to do and they will either run or they
00:11:22.240 will fail and it's wrong and so another
00:11:24.639 open source project that we've built is
00:11:26.639 our agent framework where we're uh we're
00:11:29.480 building a DSL for defining agents and
00:11:32.600 agents have hundreds of different
00:11:33.920 definitions the ones we're talking about
00:11:35.959 here are kind of like Damons that sit
00:11:38.279 around and wait for triggers in an
00:11:40.320 environment and then do some predefined
00:11:43.000 steps uh there's if you talk to 100
00:11:46.839 people you're going to get 100
00:11:47.680 definitions but so the way this DSL
00:11:49.560 works is you define um you define a
00:11:52.639 trigger you define a goal condition you
00:11:56.120 define a way for it to check its status
00:11:58.480 for on its way toward the goal condition
00:12:01.079 and then you define a way for it to take
00:12:03.200 a step and you know go through that loop
00:12:05.639 again take a step check its status am I
00:12:07.480 at my goal Etc and so we built this
00:12:10.800 agent for doing uh tdd test driven
00:12:13.560 development with us and so the way that
00:12:15.120 works is uh it's triggered anytime an
00:12:18.120 implementation file or a test file
00:12:20.240 changes the goal condition is that the
00:12:23.040 tests are passing the way it checks its
00:12:25.399 status is to run the tests and examine
00:12:28.519 the output
00:12:30.399 and then the way it takes its step is it
00:12:33.720 takes the implementation file contents
00:12:35.959 the test file contents and the test
00:12:37.639 output sends it to an llm basically
00:12:41.199 saying basically building that prompt
00:12:43.320 and saying give me the new
00:12:44.279 implementation that passes these tests
00:12:46.440 take that implementation and save it to
00:12:48.959 the file which triggers the test to run
00:12:51.199 again and um you can it goes through
00:12:54.000 that Loop and so let's see it in action
00:12:58.040 here
00:13:01.920 um okay so we have this this pile spec
00:13:03.760 class and a pile. RB and we've got the
00:13:07.160 the tests are passing which is
00:13:08.839 questionable but um spec. describe pile
00:13:13.639 and save that file the tests run they
00:13:16.560 fail because the pile class
00:13:18.560 isn't fast um they failed because the
00:13:22.000 pile class wasn't defined and the llm
00:13:25.519 generated the pile class and so we can
00:13:27.480 take that further of describe
00:13:30.399 um describe
00:13:32.399 add it adds the item to the
00:13:37.320 contents P equals pile. new p.
00:13:41.720 add
00:13:43.639 apple and P expect p. contal thank you
00:13:50.839 co-pilot um and there you go so it was
00:13:53.399 that fast that that test failed um it
00:13:56.440 generated the implementation of that
00:13:58.279 file
00:13:59.959 um and um and we can take that further
00:14:03.000 right we can go say describe
00:14:07.279 remove it
00:14:09.360 removes the item from the
00:14:15.279 contents and let's actually change the
00:14:18.040 initializer to let's say it starts with
00:14:20.600 apple and actually starts with apple and
00:14:27.240 banana and P do remove Apple
00:14:34.000 expect p.
00:14:37.240 contents
00:14:39.279 banana and test fail again we generate
00:14:44.279 the it it changes the initializer it
00:14:47.000 adds the remove method and um we can you
00:14:49.880 know we can keep going um but as I've
00:14:52.120 been playing with this like I found some
00:14:54.639 very wild things that it almost makes
00:14:56.440 this code kind of uh self-healing so so
00:14:59.279 say you know you accidentally edit edit
00:15:01.880 it um it goes back and and re
00:15:05.320 uh fixes fixes that error um but so the
00:15:10.639 other thing that I've realized as I was
00:15:12.240 doing this is you know by being more
00:15:14.240 conservative in what you're sending with
00:15:15.839 the tests and actually running them and
00:15:17.519 saying this code is either right or it's
00:15:19.240 wrong is that you can be very liberal in
00:15:22.199 what you accept back from the llm if
00:15:24.000 you're writing really good tests the
00:15:26.040 code kind of doesn't matter um you know
00:15:28.560 you might have might have instead of
00:15:31.399 writing an accessor for contents might
00:15:33.199 have used Adder reader or something um
00:15:37.040 but again that that doesn't really
00:15:39.360 matter um you can write continue to
00:15:41.079 write tests to like make sure that it's
00:15:42.680 not used in the wrong way but um but I
00:15:46.880 think that it unlocks unlocks a really
00:15:49.360 uh a really cool process and a really
00:15:51.480 cool uh you know relationship with the
00:15:54.240 code
00:15:56.680 um but we can take it further
00:16:00.720 um and we can combine those two ideas oh
00:16:03.839 shoot uh
00:16:07.040 color
00:16:08.759 shine um we can combine those two ideas
00:16:11.959 um so so so say you've bought into this
00:16:13.959 idea of I'm going to store patterns in
00:16:16.399 my codebase and um and use those to
00:16:19.279 generate new code and it's going to
00:16:21.319 hallucinate things that don't exist and
00:16:24.199 I'm bought into writing tests and making
00:16:26.480 sure that uh writing really good tests
00:16:29.160 to make sure that this code
00:16:31.880 works so say for example you're working
00:16:35.279 on a uh a chess app and you've you know
00:16:38.680 you've built your Rook piece and you run
00:16:42.680 our spec spec
00:16:45.000 Rook the test pass and the next step is
00:16:48.800 to create the queen and the Queen's
00:16:52.600 probably going to have the same
00:16:53.839 interface it's going to have a symbol
00:16:56.120 probably include these modules um um you
00:16:59.519 know it looks like we're we have this
00:17:00.920 move Dar interface for pieces um which
00:17:04.480 The Rook calls horizontal dors and we
00:17:07.400 take this we highlight it we store it as
00:17:09.439 a blueprint which again this is got a
00:17:11.760 blueprint rail server running locally
00:17:14.039 that I send this code to it it generates
00:17:16.520 a description generates vector
00:17:18.360 embeddings and makes that available for
00:17:20.640 me to generate new code later and so the
00:17:24.039 next step is we go to Queen and we can
00:17:26.919 see that we've already
00:17:31.760 we've already written the queen tests
00:17:34.760 and it fails
00:17:37.520 because uh uninitialized constant
00:17:40.559 Queen and so we follow that process
00:17:43.840 where we highlight this we send it to
00:17:46.799 the the server it finds The Rook piece
00:17:50.520 and generates that prompt of you know
00:17:53.440 here is an example of a rook piece in
00:17:55.240 our uh in our app generate me a queen
00:17:57.600 generate me a variation of that Brook
00:17:59.280 piece and so it did it faster than I
00:18:01.640 could finish talking about it um it's
00:18:04.280 got the symbol it's got moved dors it
00:18:06.200 used the horizontal dares but it
00:18:08.320 hallucinated the diagonal dares the
00:18:10.120 diagonal dares wasn't in that Rook um
00:18:14.080 wasn't in that Rook implementation so we
00:18:17.320 save that file and we can run the tests
00:18:19.080 again but they still fail and they still
00:18:21.760 fail
00:18:23.320 because uh uninitialized local variable
00:18:25.840 or method diagonal dors
00:18:29.760 and so you know we see that failure and
00:18:32.200 we're like okay well let's let's see
00:18:33.880 what's going on in
00:18:36.080 slidable slidable has slidable defines
00:18:38.960 horizontal dures but it exposes the the
00:18:42.320 diagonal dures through a method called X
00:18:44.440 dures and who knows why that happen so
00:18:47.120 maybe somebody was trying to be funny
00:18:48.200 one day and it passed PR review um but
00:18:52.280 you also don't want to go and refactor
00:18:54.080 the entire code base maybe there is a
00:18:55.559 really good reason for it and
00:19:01.080 so Ruby makes it possible to handle
00:19:04.840 those kind of hallucinations because
00:19:06.960 while llms are hallucinating they's
00:19:09.159 still the the intent is still there and
00:19:12.000 so we can determine the intent of what
00:19:15.080 the llm meant by this diagonal dares and
00:19:17.559 Ruby gives us the tools to do that and
00:19:20.480 so we've created this module to help uh
00:19:25.200 to help make that possible uh it's very
00:19:27.200 hard to say I need to come up with a
00:19:28.440 better name name for it but uh we call
00:19:30.760 it synonym which allows you to hook into
00:19:34.559 method missing and allow you to call
00:19:36.799 methods by synonym so we essentially
00:19:39.400 build a you know anytime method missing
00:19:42.400 is called um we essentially build a
00:19:45.400 prompt of this class just got this
00:19:47.960 message um and we don't know what to do
00:19:50.480 with it here are here's the
00:19:52.080 implementation of the class here are the
00:19:54.080 available methods for this uh this class
00:19:57.400 is there anything that might be a of
00:19:59.080 what this person tried to um tried to
00:20:02.840 call and if so call it so if we go ahead
00:20:09.960 and require
00:20:13.600 it and include
00:20:18.480 it Moment of Truth uh and run the test
00:20:22.000 again the test
00:20:26.880 pass uh it failed a couple times in
00:20:31.080 practice um and so yeah right now we're
00:20:35.679 just calling this but there's a lot of
00:20:37.919 different things that you can do and
00:20:39.400 Ruby makes possible that you might not
00:20:41.880 exactly want this Behavior but it could
00:20:44.480 Define aliases on your class it could
00:20:46.919 output that to a um output that to a
00:20:49.919 file it could output it in your test um
00:20:52.880 in your test Suite that hey maybe you
00:20:55.360 know maybe this diagonal D's name is a
00:20:57.360 better name than x D's and the llm keeps
00:20:59.840 generating all of these things um and so
00:21:02.679 you might not use it at runtime but you
00:21:04.559 might use it in your test Suite to uh to
00:21:06.880 actually help guide you and create
00:21:08.080 better
00:21:09.120 names um or you know this you this might
00:21:13.039 be you know making a lot of people
00:21:14.360 uncomfortable and that's fine too
00:21:18.159 um um but there are also other types of
00:21:22.679 programs that we write that you don't
00:21:24.400 necessarily need um they're not they're
00:21:27.240 not Mission critical nobody's going to
00:21:28.760 any money nothing's nothing's going
00:21:30.400 nothing bad is really going to happen um
00:21:32.840 and the llms make it possible to start
00:21:35.240 exploring um new ways to write programs
00:21:37.760 that can handle that and Ruby makes it
00:21:40.640 possible to um makes it possible to
00:21:44.799 really explore that and explore that
00:21:46.120 easily so say you were you were writing
00:21:48.679 a script I forgot to do the color on all
00:21:51.760 these
00:21:53.520 sorry um so say you were you were
00:21:56.080 writing a script a script really quickly
00:21:58.279 to figure out what day of week a
00:22:00.559 particular date in the past is and you
00:22:03.279 know you're just doing this really quick
00:22:04.480 you don't want to go and look up the API
00:22:06.840 docs because you know that there's there
00:22:08.960 is a method here for um figuring this
00:22:11.919 out um but you can at least write the
00:22:14.720 method with your
00:22:16.000 intent and um
00:22:20.400 oops uh spoiler alert um you know you
00:22:23.880 run it day of week isn't defined on date
00:22:27.320 and um
00:22:29.159 you know again you don't want you don't
00:22:30.679 have time you don't want to go and look
00:22:31.880 at um look at the API docs for date and
00:22:34.120 try to figure this out um you can just
00:22:36.159 slap this code together and Ruby makes
00:22:39.000 it very easy to do that you can just
00:22:42.520 monkey patch date and you can add the
00:22:45.000 synonym module to it
00:22:50.679 and there you go uh December 21st 1995
00:22:54.440 was a
00:22:57.000 Thursday um so again you know I think
00:23:00.640 these are this is really just like the
00:23:02.240 tip of the iceberg um you know pulling
00:23:04.400 on one thread from from postell's law as
00:23:08.200 as a guiding principle um but I think
00:23:10.559 there's a lot out there and it's really
00:23:12.960 exciting that I can you know a lot of
00:23:15.120 these ideas were we you know came out of
00:23:17.799 a discussion and we had running code
00:23:20.640 that day to see what this feels like um
00:23:23.320 and that's really exciting because a lot
00:23:25.200 of times a lot of times really good
00:23:27.960 ideas
00:23:29.039 really sound like very bad ideas at
00:23:31.720 first and if it takes you days or weeks
00:23:34.799 or months to actually test these ideas
00:23:36.400 out you just don't try those and you
00:23:37.799 don't find those good ideas and I think
00:23:40.600 that's really important and I I'm I'm so
00:23:43.080 excited by um you know all of these
00:23:46.559 possibilities and all of the new new
00:23:48.159 ways to to write code and it's super
00:23:51.240 excited they're super excited that Ruby
00:23:53.799 makes that possible because yeah here
00:23:56.679 you know we're monkey patching our own
00:23:57.919 or we're we're including these modules
00:23:59.320 into our own classes we're monkey
00:24:00.760 patching date but when we do find those
00:24:03.840 things to really
00:24:07.039 um to really use those in all of our
00:24:09.400 programs Ruby makes that easy
00:24:15.200 too um we can add this to all of our
00:24:19.720 code with one
00:24:24.320 line and yeah I was as I was as I was
00:24:27.240 writing this I had that I was going to
00:24:28.880 use wise put your best best practices
00:24:30.799 away and it autoc completed I'm going to
00:24:32.399 Monkey patch the world and I thought I
00:24:34.720 keep that in
00:24:41.520 there okay so like I said this is really
00:24:45.799 really just I think the tip of the
00:24:47.039 iceberg and there's so much exciting
00:24:48.880 stuff that's possible that that really
00:24:51.200 isn't being explored because
00:24:57.320 um you know because it's so new and and
00:25:00.399 and you know we're kind of just getting
00:25:02.120 started um but you know I don't know if
00:25:05.240 any of you have ever thought like I wish
00:25:06.919 I was around in the early days of rails
00:25:08.840 or the early days of all the things that
00:25:10.559 we um you know we kind of take for
00:25:12.799 granted are using today um that
00:25:15.480 opportunity is back um there is there is
00:25:18.320 a wide open space for all of your ideas
00:25:20.640 and all of your um you know all of your
00:25:23.039 experiments and there's a handful of us
00:25:25.000 in the Ruby AI Builders Discord doing
00:25:27.039 that um you know tons of more
00:25:29.159 experiments a lot of us have created um
00:25:31.520 you know hooking into method missing and
00:25:33.120 actually just writing the implementation
00:25:35.159 of the code if we can determine the
00:25:36.720 intent of the the class and the method
00:25:39.279 um you know experiments around rails
00:25:41.600 apps with just uh just a
00:25:44.000 404 uh route and determining what the
00:25:47.360 controller action should do by the uh by
00:25:50.360 the the route the HTTP method and the
00:25:53.679 parameters um but there's there's a lot
00:25:56.399 more there's a lot more and we would
00:25:57.960 love have you and love to to to share
00:26:00.720 your experiments so I hope I hope this
00:26:02.399 has inspired some of
00:26:06.760 you um thank you everybody this this is
00:26:09.880 my
00:26:17.919 talk um all the resources are available
00:26:20.799 at subl layer.com going postel and if
00:26:22.799 you missed the Discord links that's all
00:26:25.320 on there as well um but if this is
00:26:28.320 inspired any of you please come talk to
00:26:29.600 me afterwards I love to talk about this
00:26:31.159 stuff and love to hear your ideas thank
00:26:33.320 you again
Explore all talks recorded at RubyConf 2024
+64