We all know the classic dad joke that goes something like this:

1. Somebody says a sentence to describe their self (e.g. I'm tired or I'm confused).

2. A dad-joke enthusiast comes along and replies Hi <adjective>, I'm Dad!, because introductions follow the same format (I'm Peter follows the same format as I'm hungry).

Your job is to take in an input in the form of a self-descriptor, and output the appropriate dad-joke form, but instead of using the word "Dad", you'll use the name of the programming language you're programming in.

Test cases (assume that they are being parsed by Python):

I'm amazing                  Hi amazing, I'm Python!
I'm tired                    Hi tired, I'm Python!
I'm hungry                   Hi hungry, I'm Python!
I'm fat                      Hi fat, I'm Python!


Now assume that these test cases are being parsed by Golfscript:

I'm a programmer             Hi a programmer, I'm Golfscript!
I'm a question-writer        Hi a question-writer, I'm Golfscript!
I'm a Stack-Overflow-er      Hi a Stack-Overflow-er, I'm Golfscript!


The exact challenge:

1. Take in a string in the self-descriptor format (I'm <adjective> or I'm a(n) <noun>) using standard input or through a function.

• Assume there is no ending punctuation.

• Assume the word I'm is used and not I am.

2. Convert it to a dad-joke format - see the above examples for exactly how that should look.

Other stuff:

You can view the leaderboard for this post by expanding the widget/snippet below. In order for your post to be included in the rankings, you need a header (# header text) with the following info:

• The name of the language (end it with a comma , or dash -), followed by...

• The byte count, as the last number to appear in your header.

For example, JavaScript (ES6), 72 bytes is valid, but Fortran, 143 bytes (8-bit) is invalid because the byte count is not the last number in the header (your answer will be recognized as 8 bytes - don't take advantage of this).

<iframe src="https://ozewski.github.io/ppcg-leaderboard/?id=185872" width="100%" height="100%" style="border: none;">Oops, your browser is too old to view this content! Please upgrade to a newer version of your browser that supports HTML5.</iframe><style>html,body{margin:0;padding:0;height:100%;overflow:hidden}</style>

• One of the ways I considered telling my family that my wife was expecting was by telling as many dad jokes as possible and seeing who caught on! – Giuseppe May 21 at 0:54
• Some example outputs end with exclamation and some do not. What is the significance? – recursive May 21 at 1:56
• Usual practice is to give it much longer before accepting an answer, if you do so at all: codegolf.meta.stackexchange.com/q/2035/66252 – user2390246 May 21 at 10:58
• And the tie-breaker isn't votes, it's who reached the lowest score first. – Shaggy May 21 at 12:08
• Now waiting for the next golfing language that's name is an empty string. – 640KB May 21 at 18:24

## Javascript (Node.js in TIO), 60 bytes

s=>"Hi"+s.slice(3)+", I'm J"+process.argv[0].slice(6,15)+"!"


Try it online

• javascript is shorter than "+process.argv[0].slice(5,15)+" – Nahuel Fouilleul May 21 at 9:28
• @NahuelFouilleul yes, but +process.argv[0].slice(5,15)+ is more fun ;-) – Johan du Toit May 21 at 9:37
• The consensus on language names is that we must use proper casing - JavaScript, not javascript. – Shaggy May 21 at 12:10
• @Shaggy, point taken. – Johan du Toit May 22 at 5:03

x=>Hi${x.slice(3)}, I'm JavaScript!  Try it online! # Wolfram Language (Mathematica), 43 bytes "Hi"<>#~StringDrop~3<>", I'm Mathematica!"&  Try it online! # T-SQL, 44 bytes SELECT STUFF(v,1,3,'Hi')+', I''m SQL!'FROM t  Input is taken via pre-existing table t with text field v, per our IO standards. STUFF is shorter than variations using SUBSTRING or RIGHT. Can handle multiple inputs (as separate rows in t), although that's not required. # Befunge-93, 45 bytes "iH",,~~~>~# :1+#,_0"!39-egnufeB m'I ,">:#,_@  Try it online! Dissected: "iH",, Push then output constant "Hi" ~~~ Read "I'm" from output, which gets unused >~# :1+#,_ Non-wrapping cat program 0"!39-egnufeB m'I ," Push null-terminated constant string to stack >:#,_@ Output string and exit  # Canvas, 19 bytes ｊｊｊHiŗ, I'm Canvas!  Try it here! 18 bytes only handling single letter names # C (gcc), 49 bytes +3 Bytes: was not working -3 Bytes: K&R style function. thanks JohanduToit This is similar to the answer from Neil A. but takes the input as commandline arguments instead of a function parameter. main(b,a)char**a;{printf("Hi%s, I'm C!",a[1]+3);}  Try it online! • Oh, thanks! @JohanduToit Don't know how I missed that. – peterzuger May 22 at 6:34 # PowerShell Core, 53 bytes Filter f{$_-replace"(...)(.*)",'Hi$2,$1 PowerShell'}


Try it online!

Probably could do more improvement on the regex. Oh well.

# Sinclair ZX80 BASIC, 92 tokenized BASIC bytes

As the Sinclair ZX80 character set only allows for upper-case and 'inversed' characters, and doesn't include a single-quote, shifted-E is substituted here. There is no exclamation mark in the ZX80 character set either - Source.

 1 INPUT A$2 FOR I=0 TO 2 3 LET A$=TL$(A$)
4 NEXT I
5 PRINT "HI";A$;"," 6 PRINT "I'M SINCLAIR ZX80 BASIC"  How it works: Line 1 takes the input as a string value to A$; Line 2 - 4 creates a loop to remove the first three characters of the entered value; Line 5 - 6 then outputs the ultimate Dad joke.

# AWK, 28 25 bytes

$1="Hi",$0=$0", I'm AWK!"  Try it online! This program modifies the contents of field "$1" and "$0" in a range pattern. Because no actions are specified after the pattern, the default action {print$0} is executed.

# GFortran, 80 76 bytes

As usual, Fortran string handling is clunky and annoying!

try it online

character(99)S;read(*,'(A)')S
print*,'Hi',trim(S(4:)),', I''m GFortran!'
end


This is how I compile and run it (on Mac with homebrew + gcc + source file dad.f):

$gfortran -std=gnu -Wextra -Wall -pedantic -ffree-form -fcheck=all -fbacktrace dad.f -o dad.app # C# (Visual C# Interactive Compiler), 33 bytes n=>$"Hi{n.Substring(3)}, I'm C#!"


Try it online!

# K (ngn/k), 21 bytes

{"Hi",3_x,", I'm K!"}


Try it online!

# Red, 39 bytes

func[s][rejoin["Hi"at s 4", I'm Red!"]]


Try it online!

# Nim, 32 bytes

s=>"Hi"&s[3..s.len]&", I'm Nim!"


Try it online!

# Icon, 52 bytes

procedure d(s);return"Hi"||s[4:0]||", I'm Icon!";end


Try it online!

function(x:String)return'Hi${x.substr(3)}, I\'m Haxe!'  Try it online! # Charcoal, 21 bytes Hi✂Ｓ³Ｐ, I'm Charcoal!  Try it online! Link is to verbose version of code. Explanation: ✂ is the Slice operator which normally takes four arguments, however the use of the P command to output the suffix allows Charcoal to deduce that the last two arguments were omitted. # APL+WIN, 31 21 bytes 10 bytes saved by taking on board Adam's comments. Thanks. "Hi",3↓⎕,", I'm APL!"  Prompts for input string. Try it online! Courtesy of dzaima/APL # PowerShell, 424140 37 bytes -1 byte thanks to Spitemaster "Hi$($args|% s*g 3), I'm PowerShell!"  Try it online! There might be a cheaper automatic variable holding the PowerShell version hiding somewhere but I'm not sure. Answer takes the substring after I'm to the end and builds a string with it. • You could save a byte by only skipping 3 characters and outputting "Hi$_, I'm PowerShell!" – Spitemaster May 21 at 14:15
• @Spitemaster Oh yeah, I guess I could. Thanks – Veskah May 21 at 14:28
• @Veskah You can output the working directory with $pshome but that prints something like /opt/microsoft/powershell/6 – Jeff Freeman May 23 at 15:39 # SNOBOL4 (CSNOBOL4), 55 bytes  INPUT "I'M" REM . X OUTPUT ="HI" X ", I'M SNOBOL" END  Try it online! # Clojure, 36 bytes #(str"Hi"(subs % 3)", I'm Clojure!")  # Forth (gforth), 40 bytes : f 3 -3 d+ ." Hi"type ." , I'm Forth!";  Try it online! ### Code Explanation : f \ start a new word definition 3 -3 d+ \ add 3 to the starting address and subtract 3 from the string length ." Hi"type \ output "Hi" followed by all but the first 3 characters of the input string ." , I'm Forth!"; \ output ", I'm Forth!" and end the word definition  # Kotlin, 34 bytes "Hi${i.substring(3)}, I'm Kotlin!"


Try it online!

# Kotlin, 26 bytes

Is this a loop hole ?

"Hi${i.s(3)}, I'm Kotlin!"  Try it online! The 26 is definitely a loophole else I can golf it to 5 bytes with: i.k()  which is meaningless. Try it online! # VSL, 51 bytes fn f(s:String){print("Hi "+s[from:4]+", I'm VSL!")}  Glad VSL can now participate in some golfs :) Try it online! (doesn't have latest VSL so might not work just yet) • Are you doing much with Teascript these days? It was a cool project,.. – roblogic May 24 at 4:31 • @roblogic unfortunately not anymore. I ended up adding most of its better features (unicode shortcuts, compression) to Japt so now that's generally always the better choice – Downgoat May 24 at 4:38 # Lua, 68 59 bytes function d(s)return(s:gsub("(I\'m)(.*)","Hi%2, %1 Lua"))end  Uses a pattern to swap in the I'm in the original and then returns the joke. Having chucks on a single line like this is valid, but ugly. Edit: More efficient use of gsub • Consider adding a short explanation to your answer. Code-only answers tend to get automatically flagged as low quality. – mbomb007 May 22 at 13:40 • @mbomb007 Thanks; I updated my answer. – Scribblemacher May 22 at 14:26 # ReRegex, 31 bytes ^I'm/Hi/[^!]$/$0, I'm ReRegex!/  This assumes input doesn't end on !. TIO # Julia 1.0, 30 bytes s->"Hi$(s[4:end]), I'm Julia!"


Try it online!

# Ed, 30 bytes

I couldn't leave a sed answer without an ed answer!

%s/I'm$$.*$$/Hi\1, I'm ed!
wq


Try it online!

• I prepended a “#” to your post's first line to turn it into heading, so the Leaderboard script be able to parse it and list it. Funny choice for the link, though I'm sure some readers would be happier with something more informative. – manatwork May 23 at 15:41
• Thank you, manatwork. gnu.org/software/ed would be a reasonable place to go to learn more about ed. – Jeff Schaller May 23 at 15:48

# JavaScript (V8), 37 bytes

s=>Hi\${s.slice(3)}, I'm JavaScript!
`

Try it online!