In a 3-quart stainless steel saucier, whisk together sugar, cornstarch, salt, and eggs, followed by pineapple purée and lemon juice. (If you like, save the pineapple core and lemon rind to make a no-cook pineapple syrup .) Cook over medium-low heat, whisking gently but constantly, until warm, about 3 minutes. Increase heat to medium and continue whisking until thick and steaming-hot, about 2 minutes longer. When the custard begins to bubble, set a timer and continue whisking for exactly 30 seconds to neutralize a starch-dissolving enzyme found in egg yolks.
Strain through a nonreactive sieve into a nonreactive container, then whisk in cream, rum (if using), and vanilla. Cover and refrigerate or place in an ice bath until no warmer than 40°F (4°C). Churn in an ice cream maker according to the manufacturer’s directions. Meanwhile, place a 1-quart container and flexible spatula in the freezer.
When the ice cream looks thick and light, shut off the machine and, using the chilled spatula, scrape ice cream into the chilled container. Enjoy as soft-serve, or cover with plastic pressed directly against surface of ice cream, then close lid and freeze until firm enough to scoop, about 4 hours.