QSCM – A Smooth Blend of Scheme and C

Posted on January 22, 2021. Filed under: Uncategorized | Tags: , , , |

QSCM – A Smooth Blend of Scheme and C … I became interested in compilers, and more specifically bootstrapped compilers. These compilers are able to ingest their own source code and compile themselves. This page describes my first attempt at writing such a compiler.

Read Full Post | Make a Comment ( Comments Off on QSCM – A Smooth Blend of Scheme and C )

Array comparison in Perl XS

Posted on March 13, 2019. Filed under: Uncategorized | Tags: , , , , , , |

Array comparison in Perl XS Comparing two 1-dimensional arrays for equality in XS. Also available on github

Read Full Post | Make a Comment ( Comments Off on Array comparison in Perl XS )

Bit Twiddling Hacks

Posted on August 28, 2018. Filed under: Uncategorized | Tags: , , |

Bit Twiddling Hacks Many public domain algorithms (with C implementations) for low-level messing with bits. Some examples: Compute the minimum or maximum of two integers Determining if an integer is a power of 2 Counting bits set Swapping individual bits Reversing bit sequences Finding integer log base 2 of an integer (aka the position of […]

Read Full Post | Make a Comment ( Comments Off on Bit Twiddling Hacks )

Bulk88 – “Writing XS in Plain C”

Posted on June 23, 2017. Filed under: Uncategorized | Tags: , , , , , , , |

Writing XS in Plain C Even if you learned C in a classroom at some point, Perl’s “XS” API for writing perl subs in something purported to be C but is really a cat on a tablet with caps lock on. In this talk I will show how difficult it is to write subs in […]

Read Full Post | Make a Comment ( Comments Off on Bulk88 – “Writing XS in Plain C” )

XS Mechanics

Posted on May 4, 2017. Filed under: Uncategorized | Tags: , , , |

XS Mechanics is an article in five parts about XS. It explains what it is, why it is, how it works, and how to use it. It includes a complete, working example of an XS module, and a stub module that you can use as a starting point for your own code. It is an […]

Read Full Post | Make a Comment ( Comments Off on XS Mechanics )

Getting started with XS

Posted on May 4, 2017. Filed under: Uncategorized | Tags: , , , , , , , |

Part 1: Getting started with XS Part 2: Writing your own XS functions Part 3: XS utility routines that are good to know eXtendable Subroutines (XS) are subroutines written in C that are callable from Perl code. There are two common reasons you’d want to use XS: there is a C library you’d like to […]

Read Full Post | Make a Comment ( Comments Off on Getting started with XS )

Wrapping a C shared library with Perl and XS

Posted on March 18, 2017. Filed under: Uncategorized | Tags: , , , , , , |

Wrapping a C shared library with Perl and XS This tutorial shows how to wrap a C shared library using XS and Perl (including creating a trivial test shared library). Also posted to PerlMonks where the discussion references InlineX::C2XS.

Read Full Post | Make a Comment ( Comments Off on Wrapping a C shared library with Perl and XS )

Callback Functions Between C and Perl

Posted on February 27, 2017. Filed under: Uncategorized | Tags: , , |

Callback Functions Between C and Perl Everything you ever want to do with xs is documented somewhere in perlxs, perlguts, perlapi, perlxstypemap, and perlcall. Figuring out where it’s documented, and how it relates to everything else, is the hard part.

Read Full Post | Make a Comment ( Comments Off on Callback Functions Between C and Perl )

Learn C Programming With 9 Excellent Open Source Books

Posted on February 6, 2017. Filed under: Uncategorized | Tags: , , |

Learn C Programming With 9 Excellent Open Source Books The C Book C Elements of Style Build Your Own Lisp The GNU C Reference Manual The GNU C Programming Tutorial Essential C Beej’s Guide to C Programming Modern C An Introduction to GCC

Read Full Post | Make a Comment ( Comments Off on Learn C Programming With 9 Excellent Open Source Books )

Fast tr/// using FFI::TinyCC, FFI::Platypus and Alien::TinyCC

Posted on May 3, 2016. Filed under: Uncategorized | Tags: , , , , |

Re^2: Remove double bracket and singe quotes

Read Full Post | Make a Comment ( Comments Off on Fast tr/// using FFI::TinyCC, FFI::Platypus and Alien::TinyCC )

Liked it here?
Why not try sites on the blogroll...