- An actor is "cast" in a role: Jane Lee is cast as "Jo Smith".
- A sculpture is "cast" in bronze: molten bronze is poured into a mould.
- A variable is "cast" as a certain type of information in programming: is
1
the number one, or a string consisting of the character'1'
? You "cast" it to resolve that problem.
Are these all the same verb at the root?
Here are the relevant verb definitions from Oxford Dictionaries Online:
1 [usually with adverbial of direction] chiefly literary Throw (something) forcefully in a specified direction: he cast the book down on to the chair angrily the fishermen cast a large net around a school of tuna figurative individuals who do not accept the norms are cast out from the group
4 Shape (metal or other material) by pouring it into a mould while molten: when hammered or cast, bronze could be made into tools
4.2 Arrange and present in a specified form or style: he issued statements cast in tones of reason
[unnumbered, noun] The actors taking part in a play, film, or other production: he draws sensitive performances from his inexperienced cast
Here's a definition from Merriam-Webster Learner's Dictionary for cast as a verb in relation to actors:
4 a : to assign roles for (a play, movie, etc.) to actors. cast a play
b : to assign (an actor or actress) a role in a film, play, etc. She was cast as a college professor who becomes a spy.