rzeta0, to ai
@rzeta0@mastodon.social avatar

If you struggled with the traditional #Prolog textbooks .. this short course was developed just for you.

✅ Develop understanding through hands-on bite-size examples.

✅ Example code is minimal to avoid distraction.

✅ Talk through how new ideas work, step-by-step.

✅ Avoid terminology and jargon if it is likely to hinder more than help.

YouTube: https://www.youtube.com/@prologbyexample/videos

Web: https://prologbyexample.blogspot.com/p/toc.html

GitHub: https://github.com/prologbyexample/code

Book: https://www.amazon.com/dp/B0BTQ7P69H/

#AI #logic #metaprogramming

ChristosArgyrop, to python
@ChristosArgyrop@mstdn.science avatar

Continuing the #python #CoPilot example, one can make it work by upping their prompting game.

  • In addition to the description of the algorithm, give the desired input and output.
  • It immediately suggests to define a class for intervals, followed by a line sweep over the sorted intervals.
  • It can generate some (sorted) test cases after prompting. *Surprisingly it had some issues with printing the results (for whatever reason, it could not generate the unpack-print loop, so I just did it

image/png
image/png

ChristosArgyrop,
@ChristosArgyrop@mstdn.science avatar

@mjgardner @matsuzine @Perl @EricCarroll There is another dimension that should also be considered here, that of productivity. Getting the prompting right for #largelanguagemodel to generate a chunk of code that works & testing said code, may end up taking more time than actually doing the deed by hand. It makes more sense (IMHO as a hobbyist) to have good metadata about functionality for software libraries so that they can be located & reused, with #metaprogramming generates the boilerplate.

ManningPublications, to rust

📢New in MEAP📢

Supercharge your Rustlang code with macros—the real power tools of Rust!

Rust Power Tools by Sam Van Overmeire will help you push Rust to its full potential: http://mng.bz/8rjz

#rustlang #Rust #rustprogramming #metaprogramming

oblomov, to random
@oblomov@sociale.network avatar

There's a lot of hate for C++ going around the Fediverse these days, understandably. There is many reasons to hate C++, ranging from its C roots to the breadth and width of modern revisions of the language and their standard library, so extensive that it has become progressively harder for any individual developer to have a complete understanding of the whole thing.

oblomov,
@oblomov@sociale.network avatar

One of the most controversial features in C++ is the hidden “language within the language” of templates —an emergent byproduct of the generics implementation from the first revisions of the language, that has been kept despite the obnoxious syntax for anything nontrivial and the complexity of the error messages when anything goes wrong. The resulting #metaprogramming capabilities of C++ turn out to be surprisingly powerful while at the same time falling flat in the most unexpected of ways.

oblomov,
@oblomov@sociale.network avatar

But the biggest issue with C++ #templates #metaprogramming isn't just the syntax (that has been improving in the last years) and the errors. To paraphrase an XML joke, «C++ metaprogramming is like violence, if it doesn't solve your problems, you're not using enough of it.»
The moment you start using metaprogramming, it creeps into every corner of the code base, often requiring several layers of indirection and extensive auxiliary classes to achieve a relatively simple “user” interface.

oblomov,
@oblomov@sociale.network avatar

That being said, I'm actually among the perverts that are fascinated by #templateMetaProgramming (even though I'm well aware of its limitations pertaining readability and maintainability). Which is why I took @tess venting as an opportunity to challenge myself into writing a workable approach to generic properties for C++ objects with a common interface:

http://wok.oblomov.eu/tecnologia/cpp-template-properties/

#OOP #CPlusPlus #macros #property #tagClass #traits #templates #metaprogramming #interfaces

henrik, to ruby
@henrik@ruby.social avatar

Since publishing https://thepugautomatic.com/2023/07/ruby-module-builder-patterns I’ve improved it, so have another look:

  • Added a “Non-initializer builders” section based on comments from @maxim. (Thanks!)
  • Added a “Module identity” section based on the same discussion.
  • This morning, after the penny dropped the rest of the way, I rewrote the initial “The instance-mixin duality” section extensively to hopefully be clearer.
  • Also, footnotes!

#ruby #metaprogramming

henrik, to ruby
@henrik@ruby.social avatar
ssfckdt, to php
@ssfckdt@mastodon.cloud avatar

I remember when "real" #programmers made fun of #PHP for its things like "magic #methods"

Well today I learned about #Python's "#dunders"

mjgardner, (edited )
@mjgardner@social.sdf.org avatar

@ssfckdt Bondage-and-discipline #programming languages at which you can throw waves of interchangeable newbies make life easier for business managers.

#Perl’s reputation was spoiled by waves of newbies producing bad code anyway during the early “Web 1.0” years, followed by a splintering of its core community as #Perl6 (now #RakuLang)’s long development Osborned it to outsiders.

It didn’t have much to do with its #metaprogramming capabilities.

jbzfn, to random
@jbzfn@mastodon.social avatar

🤔 The Expressivity Limitations of Object-Oriented Programming
➥ two-wrongs.com

"tl;dr: Writing software is encoding knowledge. Knowledge takes the shape of propositions. Compressing rich propositions into is-a and has-a relationships does not lend itself to clarity."

#OOP #MetaProgramming
https://two-wrongs.com/expressive-limitations-of-oop

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines